<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
  <link href='https://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css' /><title>mongorestore &mdash; MongoDB Manual</title><link rel="shortcut icon" href="https://media.mongodb.org/favicon.ico" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="index" />

  <meta name="release" content="4.2.5"/>
  <meta name="version" content="4.2"/>
  <meta name="DC.Source" content="https://github.com/mongodb/docs/blob/v4.2/source/reference/program/mongorestore.txt"/>
  <meta property="og:image" content="http://s3.amazonaws.com/info-mongodb-com/_com_assets/cms/mongodb-for-giant-ideas-bbab5c3cf8.png">
  <meta property="og:image:secure_url" content="https://webassets.mongodb.com/_com_assets/cms/mongodb-for-giant-ideas-bbab5c3cf8.png">
      <link rel="canonical" href="https://docs.mongodb.com/manual/reference/program/mongorestore" />
  
   <link rel="stylesheet" href="../../_static/mongodb-docs.css" type="text/css" />
   <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
   <link rel="stylesheet" href="../../_static/css/navbar.min.css" type="text/css" />
    
    <script type="text/javascript" src="../../_static/lib/jquery.min.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/lib/bootstrap.js"></script>
    <script type="text/javascript" src="../../_static/lib/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../_static/controller.js"></script>
      <link rel="search" type="application/opensearchdescription+xml" href="https://docs.mongodb.com/osd.xml" title="MongoDB Help"/>
<link rel="author" title="About these documents" href="../../about.html" />
<!-- <link rel="index" title="Index" href="../../genindex.html" /> -->
<link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="MongoDB Manual" href="../../index.html" />
<link rel="up" title="MongoDB Package Components" href="../program.html" />
<link rel="next" title="bsondump" href="bsondump.html" />
<link rel="prev" title="mongodump" href="mongodump.html" /><script type='text/javascript'>
   var gptadslots=[];
   var googletag = googletag || {};
   googletag.cmd = googletag.cmd || [];
   (function(){ var gads = document.createElement('script');
      gads.async = true; gads.type = 'text/javascript';
      var useSSL = 'https:' == document.location.protocol;
      gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
      var node = document.getElementsByTagName('script')[0];
      node.parentNode.insertBefore(gads, node);
   })();
</script>

<script type="text/javascript">
   googletag.cmd.push(function() {

      var pathname = location.href;
      
      if ( (pathname.indexOf("auth") >= 0) || (pathname.indexOf("security") >= 0) ) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/security', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if ( (pathname.indexOf("crud") >= 0) ||  (pathname.indexOf("query") >= 0) || (pathname.indexOf("insert") >= 0) || (pathname.indexOf("update") >= 0) || (pathname.indexOf("remove") >= 0) || (pathname.indexOf("delete") >= 0) || (pathname.indexOf("aggregation") >= 0) ) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/crud', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("shard") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/sharding', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("replica") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/replication', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("model") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/data-modeling', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("administration") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/support', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("install-mongodb-on-windows") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/install-mongodb-on-windows', [160, 600], 'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("tutorial/getting-started") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/docs_server_gettingstarted', [160, 600], 'mongodb-docs-1').addService(googletag.pubads());
      } else {
         //Adslot 1 declaration
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      }
      googletag.pubads().enableSingleRequest();
      googletag.pubads().enableAsyncRendering();
      googletag.enableServices();
   });
</script></head>
<body data-project="manual" data-project-title="MongoDB Manual" data-branch="v4.2" data-enable-marian=1>
  <!-- Google Tag Manager -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-JQHP"
                    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push(
     {'gtm.start': new Date().getTime(),event:'gtm.js'}
   );var f=d.getElementsByTagName(s)[0],
   j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
   '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
   })(window,document,'script','dataLayer','GTM-JQHP');</script>
  <!-- End Google Tag Manager -->
<div id="navbar" data-navprops='{"links": [{"url": "https://docs.mongodb.com/manual/","text": "Server","active": true},{"url": "https://docs.mongodb.com/ecosystem/drivers/","text": "Drivers"},{"url": "https://docs.mongodb.com/cloud/","text": "Cloud"},{"url": "https://docs.mongodb.com/tools/","text": "Tools"},{"url": "https://docs.mongodb.com/guides/","text": "Guides"}]}'></div>
      <script>
        window.googleSearchCx = "017213726194841070573:WMX6838984"
	window.googleSearchPlaceholder = "Search Documentation"
        window.googleSearchResultsUrl = "http://docs.mongodb.com/manual/search/"
      </script>
    <script src="../../_static/navbar.min.js"></script>
  

  <div class="content" >

   <div id="left-column">
         <aside id="sidebar" class="sidebar">
             
  <div class="sphinxsidebar" id="sphinxsidebar">
    <div id="sphinxsidebarwrapper" class="sphinxsidebarwrapper"><a href="javascript:void(0)" class="closeNav" id="closeNav">Close &times;</a>


<h3>
  <a class="index-link" href="../../index.html">MongoDB Manual</a>
</h3>


    <div class="btn-group version-sidebar">
      <button type="button" class="version-button dropdown-toggle" data-toggle="dropdown">
        
        
        Version 4.2 (current)<span class="caret"></span>
      </button>
      <ul class="dropdown-menu" role="menu">
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="master">
              
              Version 4.4 (upcoming)
            </a>
          </li>
        
          
          <li class="active">
          
            <a href="#" data-path="manual">
              
              Version 4.2 (current)
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v4.0">
              
              Version 4.0
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.6">
              
              Version 3.6
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.4">
              
              Version 3.4
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.2">
              
              Version 3.2
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.0">
              
              Version 3.0
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v2.6">
              
              Version 2.6
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v2.4">
              
              Version 2.4
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v2.2">
              
              Version 2.2
            </a>
          </li>
        
      </ul>
    </div>


<ul class="current"><li class="toctree-l1"><a class="reference internal" href="../../introduction.html">Introduction</a><ul><li class="toctree-l2"><a class="reference internal" href="../../tutorial/getting-started.html">Getting Started</a></li><li class="toctree-l2"><a class="reference external" href="https://docs.atlas.mongodb.com/getting-started/">Create an Atlas Free Tier Cluster</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/databases-and-collections.html">Databases and Collections</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/views.html">Views</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/materialized-views.html">On-Demand Materialized Views</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/capped-collections.html">Capped Collections</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/document.html">Documents</a></li><li class="toctree-l2"><a class="reference internal" href="../bson-types.html">BSON Types</a><ul><li class="toctree-l3"><a class="reference internal" href="../bson-type-comparison-order.html">Comparison/Sort Order</a></li><li class="toctree-l3"><a class="reference internal" href="../mongodb-extended-json.html">MongoDB Extended JSON (v2)</a></li><li class="toctree-l3"><a class="reference internal" href="../mongodb-extended-json-v1.html">MongoDB Extended JSON (v1)</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a><ul><li class="toctree-l2"><a class="reference internal" href="../../administration/install-community.html">Install MongoDB Community Edition</a><ul><li class="toctree-l3"><a class="reference internal" href="../../administration/install-on-linux.html">Install on Linux</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-on-red-hat.html">Install on Red Hat</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-on-red-hat-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-on-ubuntu.html">Install on Ubuntu</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-on-ubuntu-tarball.html">Install using .tgz Tarball</a></li><li class="toctree-l5"><a class="reference internal" href="../installation-ubuntu-community-troubleshooting.html">Troubleshoot Ubuntu Installation</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-on-debian.html">Install on Debian</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-on-debian-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-on-suse.html">Install on SUSE</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-on-suse-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-on-amazon.html">Install on Amazon</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-on-amazon-tarball.html">Install using .tgz Tarball</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/install-mongodb-on-os-x.html">Install on macOS</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-on-os-x-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/install-mongodb-on-windows.html">Install on Windows</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-on-windows-unattended.html">Install using msiexec.exe</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/install-enterprise.html">Install MongoDB Enterprise</a><ul><li class="toctree-l3"><a class="reference internal" href="../../administration/install-enterprise-linux.html">Install on Linux</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-red-hat.html">Install on Red Hat</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-red-hat-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-ubuntu.html">Install on Ubuntu</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-ubuntu-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-debian.html">Install on Debian</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-debian-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-suse.html">Install on SUSE</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-suse-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-amazon.html">Install on Amazon</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-amazon-tarball.html">Install using .tgz Tarball</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-os-x.html">Install on macOS</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-windows.html">Install on Windows</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-on-windows-unattended.html">Install using msiexec.exe</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/install-mongodb-enterprise-with-docker.html">Install with Docker</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/upgrade-community-to-enterprise.html">Upgrade MongoDB Community to MongoDB Enterprise</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/upgrade-to-enterprise-standalone.html">Upgrade to MongoDB Enterprise (Standalone)</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/upgrade-to-enterprise-replica-set.html">Upgrade to MongoDB Enterprise (Replica Set)</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/upgrade-to-enterprise-sharded-cluster.html">Upgrade to MongoDB Enterprise (Sharded Cluster)</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/verify-mongodb-packages.html">Verify Integrity of MongoDB Packages</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../mongo.html">The <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a><ul><li class="toctree-l2"><a class="reference internal" href="../../tutorial/configure-mongo-shell.html">Configure the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/access-mongo-shell-help.html">Access the <code class="docutils literal"><span class="pre">mongo</span></code> Shell Help</a></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/write-scripts-for-the-mongo-shell.html">Write Scripts for the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/shell-types.html">Data Types in the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li><li class="toctree-l2"><a class="reference internal" href="../mongo-shell.html"><code class="docutils literal"><span class="pre">mongo</span></code> Shell Quick Reference</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../crud.html">MongoDB CRUD Operations</a><ul><li class="toctree-l2"><a class="reference internal" href="../../tutorial/insert-documents.html">Insert Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../insert-methods.html">Insert Methods</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/query-documents.html">Query Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/query-embedded-documents.html">Query on Embedded/Nested Documents</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/query-arrays.html">Query an Array</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/query-array-of-documents.html">Query an Array of Embedded Documents</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/project-fields-from-query-results.html">Project Fields to Return from Query</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/query-for-null-fields.html">Query for Null or Missing Fields</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/iterate-a-cursor.html">Iterate a Cursor in the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/update-documents.html">Update Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/update-documents-with-aggregation-pipeline.html">Updates with Aggregation Pipeline</a></li><li class="toctree-l3"><a class="reference internal" href="../update-methods.html">Update Methods</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/remove-documents.html">Delete Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../delete-methods.html">Delete Methods</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/bulk-write-operations.html">Bulk Write Operations</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/retryable-writes.html">Retryable Writes</a></li><li class="toctree-l2"><a class="reference internal" href="../sql-comparison.html">SQL to MongoDB Mapping Chart</a></li><li class="toctree-l2"><a class="reference internal" href="../../text-search.html">Text Search</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/link-text-indexes.html">Text Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/text-search-operators.html">Text Search Operators</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/text-search-in-aggregation.html">Text Search in the Aggregation Pipeline</a></li><li class="toctree-l3"><a class="reference internal" href="../text-search-languages.html">Text Search Languages</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../geospatial-queries.html">Geospatial Queries</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/geospatial-tutorial.html">Find Restaurants with Geospatial Queries</a></li><li class="toctree-l3"><a class="reference internal" href="../geojson.html">GeoJSON Objects</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../read-concern.html">Read Isolation (Read Concern)</a><ul><li class="toctree-l3"><a class="reference internal" href="../read-concern-local.html">Read Concern <code class="docutils literal"><span class="pre">&quot;local&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../read-concern-available.html">Read Concern <code class="docutils literal"><span class="pre">&quot;available&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../read-concern-majority.html">Read Concern <code class="docutils literal"><span class="pre">&quot;majority&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../read-concern-linearizable.html">Read Concern <code class="docutils literal"><span class="pre">&quot;linearizable&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../read-concern-snapshot.html">Read Concern <code class="docutils literal"><span class="pre">&quot;snapshot&quot;</span></code></a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../write-concern.html">Write Acknowledgement (Write Concern)</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/crud.html">MongoDB CRUD Concepts</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/write-operations-atomicity.html">Atomicity and Transactions</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/read-isolation-consistency-recency.html">Read Isolation, Consistency, and Recency</a><ul><li class="toctree-l4"><a class="reference internal" href="../../core/causal-consistency-read-write-concerns.html">Causal Consistency and Read and Write Concerns</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/distributed-queries.html">Distributed Queries</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/perform-findAndModify-linearizable-reads.html">Linearizable Reads via <code class="docutils literal"><span class="pre">findAndModify</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../../core/query-plans.html">Query Plans</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/query-optimization.html">Query Optimization</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/evaluate-operation-performance.html">Evaluate Performance of Current Operations</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/optimize-query-performance-with-indexes-and-projections.html">Optimize Query Performance</a></li><li class="toctree-l4"><a class="reference internal" href="../../core/write-performance.html">Write Operation Performance</a></li><li class="toctree-l4"><a class="reference internal" href="../explain-results.html">Explain Results</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/analyze-query-plan.html">Analyze Query Performance</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/tailable-cursors.html">Tailable Cursors</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../aggregation.html">Aggregation</a><ul><li class="toctree-l2"><a class="reference internal" href="../../core/aggregation-pipeline.html">Aggregation Pipeline</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/aggregation-pipeline-optimization.html">Aggregation Pipeline Optimization</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/aggregation-pipeline-limits.html">Aggregation Pipeline Limits</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/aggregation-pipeline-sharded-collections.html">Aggregation Pipeline and Sharded Collections</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/aggregation-zip-code-data-set.html">Example with ZIP Code Data</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/aggregation-with-user-preference-data.html">Example with User Preference Data</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/map-reduce.html">Map-Reduce</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/map-reduce-sharded-collections.html">Map-Reduce and Sharded Collections</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/map-reduce-concurrency.html">Map-Reduce Concurrency</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/map-reduce-examples.html">Map-Reduce Examples</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/perform-incremental-map-reduce.html">Perform Incremental Map-Reduce</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/troubleshoot-map-function.html">Troubleshoot the Map Function</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/troubleshoot-reduce-function.html">Troubleshoot the Reduce Function</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../aggregation.html">Aggregation Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../../meta/aggregation-quick-reference.html">Aggregation Pipeline Quick Reference</a></li><li class="toctree-l3"><a class="reference internal" href="../operator/aggregation/interface.html">Aggregation Commands</a></li><li class="toctree-l3"><a class="reference internal" href="../aggregation-commands-comparison.html">Aggregation Commands Comparison</a></li><li class="toctree-l3"><a class="reference internal" href="../aggregation-variables.html">Variables in Aggregation Expressions</a></li><li class="toctree-l3"><a class="reference internal" href="../sql-aggregation-comparison.html">SQL to Aggregation Mapping Chart</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../data-modeling.html">Data Models</a><ul><li class="toctree-l2"><a class="reference internal" href="../../core/data-modeling-introduction.html">Data Modeling Introduction</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/schema-validation.html">Schema Validation</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/data-models.html">Data Modeling Concepts</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/data-model-design.html">Data Model Design</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/data-model-operations.html">Operational Factors and Data Models</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../applications/data-models.html">Data Model Examples and Patterns</a><ul><li class="toctree-l3"><a class="reference internal" href="../../applications/data-models-relationships.html">Model Relationships Between Documents</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-embedded-one-to-one-relationships-between-documents.html">Model One-to-One Relationships with Embedded Documents</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-embedded-one-to-many-relationships-between-documents.html">Model One-to-Many Relationships with Embedded Documents</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-referenced-one-to-many-relationships-between-documents.html">Model One-to-Many Relationships with Document References</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../applications/data-models-tree-structures.html">Model Tree Structures</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-tree-structures-with-parent-references.html">Model Tree Structures with Parent References</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-tree-structures-with-child-references.html">Model Tree Structures with Child References</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-tree-structures-with-ancestors-array.html">Model Tree Structures with an Array of Ancestors</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-tree-structures-with-materialized-paths.html">Model Tree Structures with Materialized Paths</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-tree-structures-with-nested-sets.html">Model Tree Structures with Nested Sets</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../applications/data-models-applications.html">Model Specific Application Contexts</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-data-for-atomic-operations.html">Model Data for Atomic Operations</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-data-for-keyword-search.html">Model Data to Support Keyword Search</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-data-for-schema-versioning.html">Model Data for Schema Versioning</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-monetary-data.html">Model Monetary Data</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-time-data.html">Model Time Data</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/model-computed-data.html">Model Computed Data</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../data-models.html">Data Model Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../database-references.html">Database References</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../core/transactions.html">Transactions</a><ul><li class="toctree-l2"><a class="reference internal" href="../../core/transactions-in-applications.html">Drivers API</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/transactions-production-consideration.html">Production Considerations</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/transactions-sharded-clusters.html">Production Considerations (Sharded Clusters)</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/transactions-operations.html">Transactions and Operations</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../indexes.html">Indexes</a><ul><li class="toctree-l2"><a class="reference internal" href="../../core/index-single.html">Single Field Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-compound.html">Compound Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-multikey.html">Multikey Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/multikey-index-bounds.html">Multikey Index Bounds</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-text.html">Text Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/specify-language-for-text-index.html">Specify a Language for Text Index</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/avoid-text-index-name-limit.html">Specify Name for <code class="docutils literal"><span class="pre">text</span></code> Index</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/control-results-of-text-search.html">Control Search Results with Weights</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/limit-number-of-items-scanned-for-text-search.html">Limit the Number of Entries Scanned</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-wildcard.html">Wildcard Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../index-wildcard-restrictions.html">Wildcard Index Restrictions</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/2dsphere.html"><code class="docutils literal"><span class="pre">2dsphere</span></code> Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/query-a-2dsphere-index.html">Query a <code class="docutils literal"><span class="pre">2dsphere</span></code> Index</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/2d.html"><code class="docutils literal"><span class="pre">2d</span></code> Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/build-a-2d-index.html">Create a <code class="docutils literal"><span class="pre">2d</span></code> Index</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/query-a-2d-index.html">Query a <code class="docutils literal"><span class="pre">2d</span></code> Index</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/geospatial-indexes.html"><code class="docutils literal"><span class="pre">2d</span></code> Index Internals</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/calculate-distances-using-spherical-geometry-with-2d-geospatial-indexes.html">Calculate Distance Using Spherical Geometry</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/geohaystack.html"><code class="docutils literal"><span class="pre">geoHaystack</span></code> Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/build-a-geohaystack-index.html">Create a Haystack Index</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/query-a-geohaystack-index.html">Query a Haystack Index</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-hashed.html">Hashed Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-properties.html">Index Properties</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/index-ttl.html">TTL Indexes</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/expire-data.html">Expire Data from Collections by Setting TTL</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/index-unique.html">Unique Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/index-partial.html">Partial Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/index-case-insensitive.html">Case Insensitive Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/index-sparse.html">Sparse Indexes</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-creation.html">Index Builds on Populated Collections</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/build-indexes-on-replica-sets.html">Build Indexes on Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/build-indexes-on-sharded-clusters.html">Build Indexes on Sharded Clusters</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/index-intersection.html">Index Intersection</a></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/manage-indexes.html">Manage Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/measure-index-use.html">Measure Index Use</a></li><li class="toctree-l2"><a class="reference internal" href="../../applications/indexes.html">Indexing Strategies</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/create-indexes-to-support-queries.html">Create Indexes to Support Your Queries</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/sort-results-with-indexes.html">Use Indexes to Sort Query Results</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/ensure-indexes-fit-ram.html">Ensure Indexes Fit in RAM</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/create-queries-that-ensure-selectivity.html">Create Queries that Ensure Selectivity</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../indexes.html">Indexing Reference</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../security.html">Security</a><ul><li class="toctree-l2"><a class="reference internal" href="../../administration/security-checklist.html">Security Checklist</a></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/enable-authentication.html">Enable Access Control</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/authentication.html">Authentication</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/security-users.html">Users</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/create-users.html">Add Users</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/authentication-mechanisms.html">Authentication Mechanisms</a><ul><li class="toctree-l4"><a class="reference internal" href="../../core/security-scram.html">SCRAM</a></li><li class="toctree-l4"><a class="reference internal" href="../../core/security-x.509.html">x.509</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/configure-x509-client-authentication.html">Use x.509 Certificates to Authenticate Clients</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/authentication-mechanisms-enterprise.html">Enterprise Authentication Mechanisms</a><ul><li class="toctree-l4"><a class="reference internal" href="../../core/kerberos.html">Kerberos Authentication</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/control-access-to-mongodb-with-kerberos-authentication.html">Configure MongoDB with Kerberos Authentication on Linux</a></li><li class="toctree-l5"><a class="reference internal" href="../../tutorial/control-access-to-mongodb-windows-with-kerberos-authentication.html">Configure MongoDB with Kerberos Authentication on Windows</a></li><li class="toctree-l5"><a class="reference internal" href="../../tutorial/troubleshoot-kerberos.html">Troubleshoot Kerberos Authentication</a></li><li class="toctree-l5"><a class="reference internal" href="../../tutorial/kerberos-auth-activedirectory-authz.html">Configure MongoDB with Kerberos Authentication and Active Directory Authorization</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../core/security-ldap.html">LDAP Proxy Authentication</a><ul><li class="toctree-l5"><a class="reference internal" href="../../tutorial/configure-ldap-sasl-activedirectory.html">Authenticate Using SASL and LDAP with ActiveDirectory</a></li><li class="toctree-l5"><a class="reference internal" href="../../tutorial/configure-ldap-sasl-openldap.html">Authenticate Using SASL and LDAP with OpenLDAP</a></li><li class="toctree-l5"><a class="reference internal" href="../../tutorial/authenticate-nativeldap-activedirectory.html">Authenticate and Authorize Users Using Active Directory via Native LDAP</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../../core/security-ldap-external.html">LDAP Authorization</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/security-internal-authentication.html">Internal/Membership Authentication</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/deploy-replica-set-with-keyfile-access-control.html">Deploy Replica Set With Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/enforce-keyfile-access-control-in-existing-replica-set.html">Update Replica Set to Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/enforce-keyfile-access-control-in-existing-replica-set-without-downtime.html">Update Replica Set to Keyfile Authentication (No Downtime)</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/rotate-key-replica-set.html">Rotate Keys for Replica Sets</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/deploy-sharded-cluster-with-keyfile-access-control.html">Deploy Sharded Cluster with Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster.html">Update Sharded Cluster to Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster-no-downtime.html">Update Sharded Cluster to Keyfile Authentication (No Downtime)</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/rotate-key-sharded-cluster.html">Rotate Keys for Sharded Clusters</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/configure-x509-member-authentication.html">Use x.509 Certificate for Membership Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/upgrade-keyfile-to-x509.html">Upgrade from Keyfile Authentication to x.509 Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/rotate-x509-membership-certificates.html">Rolling Update of x.509 Cluster Certificates that Contain New DN</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/authorization.html">Role-Based Access Control</a><ul><li class="toctree-l3"><a class="reference internal" href="../built-in-roles.html">Built-In Roles</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/security-user-defined-roles.html">User-Defined Roles</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-users-and-roles.html">Manage Users and Roles</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/change-own-password-and-custom-data.html">Change Your Password and Custom Data</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/collection-level-access-control.html">Collection-Level Access Control</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/security-transport-encryption.html">TLS/SSL (Transport Encryption)</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-ssl.html">Configure <code class="docutils literal"><span class="pre">mongod</span></code> and <code class="docutils literal"><span class="pre">mongos</span></code> for TLS/SSL</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-ssl-clients.html">TLS/SSL Configuration for Clients</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/upgrade-cluster-to-ssl.html">Upgrade a Cluster to Use TLS/SSL</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-fips.html">Configure MongoDB for FIPS</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/security-encryption-at-rest.html">Encryption at Rest</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-encryption.html">Configure Encryption</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/rotate-encryption-key.html">Rotate Encryption Keys</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/security-client-side-encryption.html">Client-Side Field Level Encryption</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/security-automatic-client-side-encryption.html">Automatic Client-Side Field Level Encryption</a><ul><li class="toctree-l4"><a class="reference internal" href="../security-client-side-automatic-json-schema.html">Automatic Encryption Rules</a></li><li class="toctree-l4"><a class="reference internal" href="../security-client-side-query-aggregation-support.html">Read/Write Support with Automatic Field Level Encryption</a></li><li class="toctree-l4"><a class="reference internal" href="../security-client-side-encryption-appendix.html">Appendix</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/security-explicit-client-side-encryption.html">Explicit (Manual) Client-Side Field Level Encryption</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/security-client-side-encryption-key-management.html">Master Key and Data Encryption Key Management</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/manage-client-side-encryption-data-keys.html">Manage Data Encryption Keys</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../security-client-side-encryption-limitations.html">Limitations</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/auditing.html">Auditing</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-auditing.html">Configure Auditing</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-audit-filters.html">Configure Audit Filters</a></li><li class="toctree-l3"><a class="reference internal" href="../audit-message.html">System Event Audit Messages</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/security-hardening.html">Network and Configuration Hardening</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/security-mongodb-configuration.html">IP Binding</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-linux-iptables-firewall.html">Configure Linux <code class="docutils literal"><span class="pre">iptables</span></code> Firewall for MongoDB</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-windows-netsh-firewall.html">Configure Windows <code class="docutils literal"><span class="pre">netsh</span></code> Firewall for MongoDB</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/implement-field-level-redaction.html">Implement Field Level Redaction</a></li><li class="toctree-l2"><a class="reference internal" href="../security.html">Security Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../system-roles-collection.html"><code class="docutils literal"><span class="pre">system.roles</span></code> Collection</a></li><li class="toctree-l3"><a class="reference internal" href="../system-users-collection.html"><code class="docutils literal"><span class="pre">system.users</span></code> Collection</a></li><li class="toctree-l3"><a class="reference internal" href="../resource-document.html">Resource Document</a></li><li class="toctree-l3"><a class="reference internal" href="../privilege-actions.html">Privilege Actions</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/create-a-vulnerability-report.html">Create a Vulnerability Report</a></li><li class="toctree-l2"><a class="reference internal" href="../../appendix/security.html">Appendix</a><ul><li class="toctree-l3"><a class="reference internal" href="../../appendix/security/appendixA-openssl-ca.html">Appendix A - OpenSSL CA Certificate for Testing</a></li><li class="toctree-l3"><a class="reference internal" href="../../appendix/security/appendixB-openssl-server.html">Appendix B - OpenSSL Server Certificates for Testing</a></li><li class="toctree-l3"><a class="reference internal" href="../../appendix/security/appendixC-openssl-client.html">Appendix C - OpenSSL Client Certificates for Testing</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../changeStreams.html">Change Streams</a><ul><li class="toctree-l2"><a class="reference internal" href="../../administration/change-streams-production-recommendations.html">Change Streams Production Recommendations</a></li><li class="toctree-l2"><a class="reference internal" href="../change-events.html">Change Events</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../replication.html">Replication</a><ul><li class="toctree-l2"><a class="reference internal" href="../../core/replica-set-members.html">Replica Set Members</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-primary.html">Replica Set Primary</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-secondary.html">Replica Set Secondary Members</a><ul><li class="toctree-l4"><a class="reference internal" href="../../core/replica-set-priority-0-member.html">Priority 0 Replica Set Members</a></li><li class="toctree-l4"><a class="reference internal" href="../../core/replica-set-hidden-member.html">Hidden Replica Set Members</a></li><li class="toctree-l4"><a class="reference internal" href="../../core/replica-set-delayed-member.html">Delayed Replica Set Members</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-arbiter.html">Replica Set Arbiter</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/replica-set-oplog.html">Replica Set Oplog</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/replica-set-sync.html">Replica Set Data Synchronization</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/replica-set-architectures.html">Replica Set Deployment Architectures</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-architecture-three-members.html">Three Member Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-architecture-geographically-distributed.html">Replica Sets Distributed Across Two or More Data Centers</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/replica-set-high-availability.html">Replica Set High Availability</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-elections.html">Replica Set Elections</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-rollbacks.html">Rollbacks During Replica Set Failover</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../applications/replication.html">Replica Set Read and Write Semantics</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/replica-set-write-concern.html">Write Concern for Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/read-preference.html">Read Preference</a><ul><li class="toctree-l4"><a class="reference internal" href="../../core/read-preference-tags.html">Tag Sets</a></li><li class="toctree-l4"><a class="reference internal" href="../../core/read-preference-staleness.html">maxStalenessSeconds</a></li><li class="toctree-l4"><a class="reference internal" href="../../core/read-preference-use-cases.html">Read Preference Use Cases</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/read-preference-mechanics.html">Server Selection Algorithm</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/replica-set-deployment.html">Replica Set Deployment Tutorials</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/deploy-replica-set.html">Deploy a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/deploy-replica-set-for-testing.html">Deploy a Replica Set for Testing and Development</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/deploy-geographically-distributed-replica-set.html">Deploy a Geographically Redundant Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/add-replica-set-arbiter.html">Add an Arbiter to Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/convert-standalone-to-replica-set.html">Convert a Standalone to a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/expand-replica-set.html">Add Members to a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/remove-replica-set-member.html">Remove Members from Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/replace-replica-set-member.html">Replace a Replica Set Member</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/replica-set-member-configuration.html">Member Configuration Tutorials</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/adjust-replica-set-member-priority.html">Adjust Priority for Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-secondary-only-replica-set-member.html">Prevent Secondary from Becoming Primary</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-a-hidden-replica-set-member.html">Configure a Hidden Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-a-delayed-replica-set-member.html">Configure a Delayed Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-a-non-voting-replica-set-member.html">Configure Non-Voting Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/convert-secondary-into-arbiter.html">Convert a Secondary to an Arbiter</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/replica-set-maintenance.html">Replica Set Maintenance Tutorials</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/change-oplog-size.html">Change the Size of the Oplog</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/perform-maintence-on-replica-set-members.html">Perform Maintenance on Replica Set Members</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/force-member-to-be-primary.html">Force a Member to Become Primary</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/resync-replica-set-member.html">Resync a Member of a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-replica-set-tag-sets.html">Configure Replica Set Tag Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/reconfigure-replica-set-with-unavailable-members.html">Reconfigure a Replica Set with Unavailable Members</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-chained-replication.html">Manage Chained Replication</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/change-hostnames-in-a-replica-set.html">Change Hostnames in a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/configure-replica-set-secondary-sync-target.html">Configure a Secondary’s Sync Target</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../replication.html">Replication Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../replica-configuration.html">Replica Set Configuration</a></li><li class="toctree-l3"><a class="reference internal" href="../replica-set-protocol-versions.html">Replica Set Protocol Version</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/troubleshoot-replica-sets.html">Troubleshoot Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../local-database.html">The <code class="docutils literal"><span class="pre">local</span></code> Database</a></li><li class="toctree-l3"><a class="reference internal" href="../replica-states.html">Replica Set Member States</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../sharding.html">Sharding</a><ul><li class="toctree-l2"><a class="reference internal" href="../../core/sharded-cluster-components.html">Sharded Cluster Components</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/sharded-cluster-shards.html">Shards</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/sharded-cluster-config-servers.html">Config Servers (metadata)</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/sharded-cluster-query-router.html">Router (mongos)</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/sharding-shard-key.html">Shard Keys</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/hashed-sharding.html">Hashed Sharding</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/ranged-sharding.html">Ranged Sharding</a></li><li class="toctree-l2"><a class="reference internal" href="../../tutorial/deploy-shard-cluster.html">Deploy a Sharded Cluster</a></li><li class="toctree-l2"><a class="reference internal" href="../../core/zone-sharding.html">Zones</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-shard-zone.html">Manage Shard Zones</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/sharding-segmenting-data-by-location.html">Segmenting Data by Location</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/sharding-tiered-hardware-for-varying-slas.html">Tiered Hardware for Varying SLA or SLO</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/sharding-segmenting-shards.html">Segmenting Data by Application or Customer</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/sharding-high-availability-writes.html">Distributed Local Writes for Insert Only Workloads</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/sharding-data-partitioning.html">Data Partitioning with Chunks</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/create-chunks-in-sharded-cluster.html">Create Chunks in a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/split-chunks-in-sharded-cluster.html">Split Chunks in a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/merge-chunks-in-sharded-cluster.html">Merge Chunks in a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/modify-chunk-size-in-sharded-cluster.html">Modify Chunk Size in a Sharded Cluster</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/sharding-balancer-administration.html">Balancer</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-sharded-cluster-balancer.html">Manage Sharded Cluster Balancer</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/migrate-chunks-in-sharded-cluster.html">Migrate Chunks in a Sharded Cluster</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/sharded-cluster-administration.html">Administration</a><ul><li class="toctree-l3"><a class="reference internal" href="../../administration/sharded-cluster-config-servers.html">Config Server Administration</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/replace-config-server.html">Replace a Config Server</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/view-sharded-cluster-configuration.html">View Cluster Configuration</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/restart-sharded-cluster.html">Restart a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/migrate-sharded-cluster-to-new-hardware.html">Migrate a Sharded Cluster to Different Hardware</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/add-shards-to-shard-cluster.html">Add Shards to a Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/remove-shards-from-cluster.html">Remove Shards from an Existing Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/clear-jumbo-flag.html">Clear <code class="docutils literal"><span class="pre">jumbo</span></code> Flag</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/backup-sharded-cluster-metadata.html">Back Up Cluster Metadata</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/convert-sharded-cluster-to-replica-set.html">Convert Sharded Cluster to Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/convert-replica-set-to-replicated-shard-cluster.html">Convert a Replica Set to a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/convert-shard-standalone-to-shard-replica-set.html">Convert a Shard Standalone to a Shard Replica Set</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../sharding.html">Sharding Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/sharded-cluster-requirements.html">Operational Restrictions</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/troubleshoot-sharded-clusters.html">Troubleshoot Sharded Clusters</a></li><li class="toctree-l3"><a class="reference internal" href="../config-database.html">Config Database</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../administration.html">Administration</a><ul><li class="toctree-l2"><a class="reference internal" href="../../administration/production-notes.html">Production Notes</a></li><li class="toctree-l2"><a class="reference internal" href="../../administration/production-checklist-operations.html">Operations Checklist</a></li><li class="toctree-l2"><a class="reference internal" href="../../administration/production-checklist-development.html">Development Checklist</a></li><li class="toctree-l2"><a class="reference internal" href="../../administration/analyzing-mongodb-performance.html">Performance</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-the-database-profiler.html">Database Profiler</a><ul><li class="toctree-l4"><a class="reference internal" href="../database-profiler.html">Database Profiler Output</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/transparent-huge-pages.html">Disable Transparent Huge Pages (THP)</a></li><li class="toctree-l3"><a class="reference internal" href="../ulimit.html">UNIX <code class="docutils literal"><span class="pre">ulimit</span></code> Settings</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/configuration-and-maintenance.html">Configuration and Maintenance</a><ul><li class="toctree-l3"><a class="reference internal" href="../../administration/configuration.html">Run-time Database Configuration</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/upgrade-revision.html">Upgrade to the Latest Revision of MongoDB</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-mongodb-processes.html">Manage <code class="docutils literal"><span class="pre">mongod</span></code> Processes</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/terminate-running-operations.html">Terminate Running Operations</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/rotate-log-files.html">Rotate Log Files</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../data-center-awareness.html">Data Center Awareness</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/workload-isolation.html">Workload Isolation in MongoDB Deployments</a></li><li class="toctree-l3"><a class="reference internal" href="../../core/zone-sharding.html">Zones</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/manage-shard-zone.html">Manage Shard Zones</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/sharding-segmenting-data-by-location.html">Segmenting Data by Location</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/sharding-tiered-hardware-for-varying-slas.html">Tiered Hardware for Varying SLA or SLO</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/sharding-segmenting-shards.html">Segmenting Data by Application or Customer</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/sharding-high-availability-writes.html">Distributed Local Writes for Insert Only Workloads</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-shard-zone.html">Manage Shard Zones</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/backups.html">MongoDB Backup Methods</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/backup-with-filesystem-snapshots.html">Back Up and Restore with Filesystem Snapshots</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/backup-and-restore-tools.html">Back Up and Restore with MongoDB Tools</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/restore-replica-set-from-backup.html">Restore a Replica Set from MongoDB Backups</a></li><li class="toctree-l3"><a class="reference internal" href="../../administration/backup-sharded-clusters.html">Backup and Restore Sharded Clusters</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/backup-sharded-cluster-with-filesystem-snapshots.html">Back Up a Sharded Cluster with File System Snapshots</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/backup-sharded-cluster-with-database-dumps.html">Back Up a Sharded Cluster with Database Dumps</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/schedule-backup-window-for-sharded-clusters.html">Schedule Backup Window for Sharded Clusters</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/restore-sharded-cluster.html">Restore a Sharded Cluster</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/recover-data-following-unexpected-shutdown.html">Recover a Standalone after an Unexpected Shutdown</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../administration/monitoring.html">Monitoring for MongoDB</a><ul><li class="toctree-l3"><a class="reference internal" href="../../administration/free-monitoring.html">Free Monitoring</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/monitor-with-snmp.html">Monitor MongoDB With SNMP on Linux</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/monitor-with-snmp-on-windows.html">Monitor MongoDB Windows with SNMP</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/troubleshoot-snmp.html">Troubleshoot SNMP</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../storage.html">Storage</a><ul><li class="toctree-l2"><a class="reference internal" href="../../core/storage-engines.html">Storage Engines</a><ul><li class="toctree-l3"><a class="reference internal" href="../../core/wiredtiger.html">WiredTiger Storage Engine</a><ul><li class="toctree-l4"><a class="reference internal" href="../../tutorial/change-standalone-wiredtiger.html">Change Standalone to WiredTiger</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/change-replica-set-wiredtiger.html">Change Replica Set to WiredTiger</a></li><li class="toctree-l4"><a class="reference internal" href="../../tutorial/change-sharded-cluster-wiredtiger.html">Change Sharded Cluster to WiredTiger</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../core/inmemory.html">In-Memory Storage Engine</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/journaling.html">Journaling</a><ul><li class="toctree-l3"><a class="reference internal" href="../../tutorial/manage-journaling.html">Manage Journaling</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../core/gridfs.html">GridFS</a></li><li class="toctree-l2"><a class="reference internal" href="../../faq/storage.html">FAQ: MongoDB Storage</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../faq.html">Frequently Asked Questions</a><ul><li class="toctree-l2"><a class="reference internal" href="../../faq/fundamentals.html">FAQ: MongoDB Fundamentals</a></li><li class="toctree-l2"><a class="reference internal" href="../../faq/indexes.html">FAQ: Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../../faq/concurrency.html">FAQ: Concurrency</a></li><li class="toctree-l2"><a class="reference internal" href="../../faq/sharding.html">FAQ: Sharding with MongoDB</a></li><li class="toctree-l2"><a class="reference internal" href="../../faq/replica-sets.html">FAQ: Replication and Replica Sets</a></li><li class="toctree-l2"><a class="reference internal" href="../../faq/storage.html">FAQ: MongoDB Storage</a></li><li class="toctree-l2"><a class="reference internal" href="../../faq/diagnostics.html">FAQ: MongoDB Diagnostics</a></li></ul></li><li class="toctree-l1 current"><a class="reference internal" href="../../reference.html">Reference</a><ul class="current"><li class="toctree-l2"><a class="reference internal" href="../operator.html">Operators</a><ul><li class="toctree-l3"><a class="reference internal" href="../operator/query.html">Query and Projection Operators</a><ul><li class="toctree-l4"><a class="reference internal" href="../operator/query-comparison.html">Comparison Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/query/eq.html">$eq</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/gt.html">$gt</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/gte.html">$gte</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/in.html">$in</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/lt.html">$lt</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/lte.html">$lte</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/ne.html">$ne</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/nin.html">$nin</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/query-logical.html">Logical Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/query/and.html">$and</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/not.html">$not</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/nor.html">$nor</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/or.html">$or</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/query-element.html">Element Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/query/exists.html">$exists</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/type.html">$type</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/query-evaluation.html">Evaluation Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/query/expr.html">$expr</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/jsonSchema.html">$jsonSchema</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/mod.html">$mod</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/regex.html">$regex</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/text.html">$text</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/where.html">$where</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/query-geospatial.html">Geospatial Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/query/geoIntersects.html">$geoIntersects</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/geoWithin.html">$geoWithin</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/near.html">$near</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/nearSphere.html">$nearSphere</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/box.html">$box</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/center.html">$center</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/centerSphere.html">$centerSphere</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/geometry.html">$geometry</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/maxDistance.html">$maxDistance</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/minDistance.html">$minDistance</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/polygon.html">$polygon</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/uniqueDocs.html">$uniqueDocs</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/query-array.html">Array Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/query/all.html">$all</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/elemMatch.html">$elemMatch (query)</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/size.html">$size</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/query-bitwise.html">Bitwise Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/query/bitsAllClear.html">$bitsAllClear</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/bitsAllSet.html">$bitsAllSet</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/bitsAnyClear.html">$bitsAnyClear</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/query/bitsAnySet.html">$bitsAnySet</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/query/comment.html">$comment</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/projection.html">Projection Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/projection/positional.html">$ (projection)</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/projection/elemMatch.html">$elemMatch (projection)</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/projection/meta.html">$meta</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/projection/slice.html">$slice (projection)</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../operator/update.html">Update Operators</a><ul><li class="toctree-l4"><a class="reference internal" href="../operator/update-field.html">Field Update Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/update/currentDate.html">$currentDate</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/inc.html">$inc</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/min.html">$min</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/max.html">$max</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/mul.html">$mul</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/rename.html">$rename</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/set.html">$set</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/setOnInsert.html">$setOnInsert</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/unset.html">$unset</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/update-array.html">Array Update Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/update/positional.html">$ (update)</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/positional-all.html">$[]</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/positional-filtered.html">$[&lt;identifier&gt;]</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/addToSet.html">$addToSet</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/pop.html">$pop</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/pull.html">$pull</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/push.html">$push</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/pullAll.html">$pullAll</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/each.html">$each</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/position.html">$position</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/slice.html">$slice</a></li><li class="toctree-l5"><a class="reference internal" href="../operator/update/sort.html">$sort</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../operator/update-bitwise.html">Bitwise Update Operator</a><ul><li class="toctree-l5"><a class="reference internal" href="../operator/update/bit.html">$bit</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../operator/aggregation-pipeline.html">Aggregation Pipeline Stages</a><ul><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/addFields.html">$addFields (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/bucket.html">$bucket (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/bucketAuto.html">$bucketAuto (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/collStats.html">$collStats (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/count.html">$count (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/currentOp.html">$currentOp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/facet.html">$facet (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/geoNear.html">$geoNear (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/graphLookup.html">$graphLookup (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/group.html">$group (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/indexStats.html">$indexStats (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/limit.html">$limit (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/listLocalSessions.html">$listLocalSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/listSessions.html">$listSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/lookup.html">$lookup (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/match.html">$match (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/merge.html">$merge (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/out.html">$out (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/planCacheStats.html">$planCacheStats</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/project.html">$project (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/redact.html">$redact (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/replaceRoot.html">$replaceRoot (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/replaceWith.html">$replaceWith (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/sample.html">$sample (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/set.html">$set (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/skip.html">$skip (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/sort.html">$sort (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/sortByCount.html">$sortByCount (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/unset.html">$unset (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/unwind.html">$unwind (aggregation)</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../operator/aggregation.html">Aggregation Pipeline Operators</a><ul><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/abs.html">$abs (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/acos.html">$acos (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/acosh.html">$acosh (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/add.html">$add (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/addToSet.html">$addToSet (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/allElementsTrue.html">$allElementsTrue (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/and.html">$and (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/anyElementTrue.html">$anyElementTrue (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/arrayElemAt.html">$arrayElemAt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/arrayToObject.html">$arrayToObject (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/asin.html">$asin (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/asinh.html">$asinh (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/atan.html">$atan (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/atan2.html">$atan2 (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/atanh.html">$atanh (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/avg.html">$avg (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/ceil.html">$ceil (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/cmp.html">$cmp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/concat.html">$concat (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/concatArrays.html">$concatArrays (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/cond.html">$cond (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/convert.html">$convert (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/cos.html">$cos (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/dateFromParts.html">$dateFromParts (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/dateToParts.html">$dateToParts (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/dateFromString.html">$dateFromString (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/dateToString.html">$dateToString (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/dayOfMonth.html">$dayOfMonth (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/dayOfWeek.html">$dayOfWeek (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/dayOfYear.html">$dayOfYear (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/degreesToRadians.html">$degreesToRadians (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/divide.html">$divide (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/eq.html">$eq (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/exp.html">$exp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/filter.html">$filter (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/first.html">$first (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/floor.html">$floor (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/gt.html">$gt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/gte.html">$gte (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/hour.html">$hour (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/ifNull.html">$ifNull (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/in.html">$in (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/indexOfArray.html">$indexOfArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/indexOfBytes.html">$indexOfBytes (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/indexOfCP.html">$indexOfCP (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/isArray.html">$isArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/isoDayOfWeek.html">$isoDayOfWeek (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/isoWeek.html">$isoWeek (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/isoWeekYear.html">$isoWeekYear (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/last.html">$last (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/let.html">$let (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/literal.html">$literal (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/ln.html">$ln (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/log.html">$log (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/log10.html">$log10 (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/lt.html">$lt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/lte.html">$lte (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/ltrim.html">$ltrim (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/map.html">$map (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/max.html">$max (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/mergeObjects.html">$mergeObjects (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/meta.html">$meta (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/min.html">$min (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/millisecond.html">$millisecond (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/minute.html">$minute (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/mod.html">$mod (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/month.html">$month (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/multiply.html">$multiply (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/ne.html">$ne (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/not.html">$not (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/objectToArray.html">$objectToArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/or.html">$or (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/pow.html">$pow (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/push.html">$push (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/radiansToDegrees.html">$radiansToDegrees (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/range.html">$range (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/reduce.html">$reduce (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/regexFind.html">$regexFind (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/regexFindAll.html">$regexFindAll (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/regexMatch.html">$regexMatch (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/reverseArray.html">$reverseArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/round.html">$round (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/rtrim.html">$rtrim (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/second.html">$second (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/setDifference.html">$setDifference (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/setEquals.html">$setEquals (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/setIntersection.html">$setIntersection (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/setIsSubset.html">$setIsSubset (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/setUnion.html">$setUnion (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/size.html">$size (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/sin.html">$sin (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/slice.html">$slice (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/split.html">$split (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/sqrt.html">$sqrt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/stdDevPop.html">$stdDevPop (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/stdDevSamp.html">$stdDevSamp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/strcasecmp.html">$strcasecmp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/strLenBytes.html">$strLenBytes (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/strLenCP.html">$strLenCP (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/substr.html">$substr (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/substrBytes.html">$substrBytes (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/substrCP.html">$substrCP (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/subtract.html">$subtract (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/sum.html">$sum (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/switch.html">$switch (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/tan.html">$tan (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toBool.html">$toBool (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toDate.html">$toDate (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toDecimal.html">$toDecimal (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toDouble.html">$toDouble(aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toInt.html">$toInt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toLong.html">$toLong (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toObjectId.html">$toObjectId (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toString.html">$toString (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toLower.html">$toLower (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/toUpper.html">$toUpper (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/trim.html">$trim (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/trunc.html">$trunc (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/type.html">$type (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/week.html">$week (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/year.html">$year (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/aggregation/zip.html">$zip (aggregation)</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../operator/query-modifier.html">Query Modifiers</a><ul><li class="toctree-l4"><a class="reference internal" href="../operator/meta/comment.html">$comment</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/explain.html">$explain</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/hint.html">$hint</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/max.html">$max</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/maxTimeMS.html">$maxTimeMS</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/min.html">$min</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/orderby.html">$orderby</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/query.html">$query</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/returnKey.html">$returnKey</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/showDiskLoc.html">$showDiskLoc</a></li><li class="toctree-l4"><a class="reference internal" href="../operator/meta/natural.html">$natural</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../command.html">Database Commands</a><ul><li class="toctree-l3"><a class="reference internal" href="../command/nav-aggregation.html">Aggregation Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/aggregate.html">aggregate</a></li><li class="toctree-l4"><a class="reference internal" href="../command/count.html">count</a></li><li class="toctree-l4"><a class="reference internal" href="../command/distinct.html">distinct</a></li><li class="toctree-l4"><a class="reference internal" href="../command/mapReduce.html">mapReduce</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-geospatial.html">Geospatial Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/geoSearch.html">geoSearch</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-crud.html">Query and Write Operation Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/delete.html">delete</a></li><li class="toctree-l4"><a class="reference internal" href="../command/find.html">find</a></li><li class="toctree-l4"><a class="reference internal" href="../command/findAndModify.html">findAndModify</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getLastError.html">getLastError</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getMore.html">getMore</a></li><li class="toctree-l4"><a class="reference internal" href="../command/insert.html">insert</a></li><li class="toctree-l4"><a class="reference internal" href="../command/resetError.html">resetError</a></li><li class="toctree-l4"><a class="reference internal" href="../command/update.html">update</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-plan-cache.html">Query Plan Cache Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/planCacheClear.html">planCacheClear</a></li><li class="toctree-l4"><a class="reference internal" href="../command/planCacheClearFilters.html">planCacheClearFilters</a></li><li class="toctree-l4"><a class="reference internal" href="../command/planCacheListFilters.html">planCacheListFilters</a></li><li class="toctree-l4"><a class="reference internal" href="../command/planCacheListPlans.html">planCacheListPlans</a></li><li class="toctree-l4"><a class="reference internal" href="../command/planCacheListQueryShapes.html">planCacheListQueryShapes</a></li><li class="toctree-l4"><a class="reference internal" href="../command/planCacheSetFilter.html">planCacheSetFilter</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-authentication.html">Authentication Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/authenticate.html">authenticate</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getnonce.html">getnonce</a></li><li class="toctree-l4"><a class="reference internal" href="../command/logout.html">logout</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-user-management.html">User Management Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/createUser.html">createUser</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dropAllUsersFromDatabase.html">dropAllUsersFromDatabase</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dropUser.html">dropUser</a></li><li class="toctree-l4"><a class="reference internal" href="../command/grantRolesToUser.html">grantRolesToUser</a></li><li class="toctree-l4"><a class="reference internal" href="../command/revokeRolesFromUser.html">revokeRolesFromUser</a></li><li class="toctree-l4"><a class="reference internal" href="../command/updateUser.html">updateUser</a></li><li class="toctree-l4"><a class="reference internal" href="../command/usersInfo.html">usersInfo</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-role-management.html">Role Management Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/createRole.html">createRole</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dropRole.html">dropRole</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dropAllRolesFromDatabase.html">dropAllRolesFromDatabase</a></li><li class="toctree-l4"><a class="reference internal" href="../command/grantPrivilegesToRole.html">grantPrivilegesToRole</a></li><li class="toctree-l4"><a class="reference internal" href="../command/grantRolesToRole.html">grantRolesToRole</a></li><li class="toctree-l4"><a class="reference internal" href="../command/invalidateUserCache.html">invalidateUserCache</a></li><li class="toctree-l4"><a class="reference internal" href="../command/revokePrivilegesFromRole.html">revokePrivilegesFromRole</a></li><li class="toctree-l4"><a class="reference internal" href="../command/revokeRolesFromRole.html">revokeRolesFromRole</a></li><li class="toctree-l4"><a class="reference internal" href="../command/rolesInfo.html">rolesInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../command/updateRole.html">updateRole</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-replication.html">Replication Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/applyOps.html">applyOps</a></li><li class="toctree-l4"><a class="reference internal" href="../command/isMaster.html">isMaster</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetAbortPrimaryCatchUp.html">replSetAbortPrimaryCatchUp</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetFreeze.html">replSetFreeze</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetGetConfig.html">replSetGetConfig</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetGetStatus.html">replSetGetStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetInitiate.html">replSetInitiate</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetMaintenance.html">replSetMaintenance</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetReconfig.html">replSetReconfig</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetResizeOplog.html">replSetResizeOplog</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetStepDown.html">replSetStepDown</a></li><li class="toctree-l4"><a class="reference internal" href="../command/replSetSyncFrom.html">replSetSyncFrom</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-sharding.html">Sharding Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/addShard.html">addShard</a></li><li class="toctree-l4"><a class="reference internal" href="../command/addShardToZone.html">addShardToZone</a></li><li class="toctree-l4"><a class="reference internal" href="../command/balancerStart.html">balancerStart</a></li><li class="toctree-l4"><a class="reference internal" href="../command/balancerStatus.html">balancerStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../command/balancerStop.html">balancerStop</a></li><li class="toctree-l4"><a class="reference internal" href="../command/checkShardingIndex.html">checkShardingIndex</a></li><li class="toctree-l4"><a class="reference internal" href="../command/clearJumboFlag.html">clearJumboFlag</a></li><li class="toctree-l4"><a class="reference internal" href="../command/cleanupOrphaned.html">cleanupOrphaned</a></li><li class="toctree-l4"><a class="reference internal" href="../command/enableSharding.html">enableSharding</a></li><li class="toctree-l4"><a class="reference internal" href="../command/flushRouterConfig.html">flushRouterConfig</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getShardMap.html">getShardMap</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getShardVersion.html">getShardVersion</a></li><li class="toctree-l4"><a class="reference internal" href="../command/isdbgrid.html">isdbgrid</a></li><li class="toctree-l4"><a class="reference internal" href="../command/listShards.html">listShards</a></li><li class="toctree-l4"><a class="reference internal" href="../command/medianKey.html">medianKey</a></li><li class="toctree-l4"><a class="reference internal" href="../command/moveChunk.html">moveChunk</a></li><li class="toctree-l4"><a class="reference internal" href="../command/movePrimary.html">movePrimary</a></li><li class="toctree-l4"><a class="reference internal" href="../command/mergeChunks.html">mergeChunks</a></li><li class="toctree-l4"><a class="reference internal" href="../command/removeShard.html">removeShard</a></li><li class="toctree-l4"><a class="reference internal" href="../command/removeShardFromZone.html">removeShardFromZone</a></li><li class="toctree-l4"><a class="reference internal" href="../command/setShardVersion.html">setShardVersion</a></li><li class="toctree-l4"><a class="reference internal" href="../command/shardCollection.html">shardCollection</a></li><li class="toctree-l4"><a class="reference internal" href="../command/shardingState.html">shardingState</a></li><li class="toctree-l4"><a class="reference internal" href="../command/split.html">split</a></li><li class="toctree-l4"><a class="reference internal" href="../command/splitChunk.html">splitChunk</a></li><li class="toctree-l4"><a class="reference internal" href="../command/splitVector.html">splitVector</a></li><li class="toctree-l4"><a class="reference internal" href="../command/unsetSharding.html">unsetSharding</a></li><li class="toctree-l4"><a class="reference internal" href="../command/updateZoneKeyRange.html">updateZoneKeyRange</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-sessions.html">Sessions Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/abortTransaction.html">abortTransaction</a></li><li class="toctree-l4"><a class="reference internal" href="../command/commitTransaction.html">commitTransaction</a></li><li class="toctree-l4"><a class="reference internal" href="../command/endSessions.html">endSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../command/killAllSessions.html">killAllSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../command/killAllSessionsByPattern.html">killAllSessionsByPattern</a></li><li class="toctree-l4"><a class="reference internal" href="../command/killSessions.html">killSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../command/refreshSessions.html">refreshSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../command/startSession.html">startSession</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-administration.html">Administration Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/clean.html">clean</a></li><li class="toctree-l4"><a class="reference internal" href="../command/cloneCollection.html">cloneCollection</a></li><li class="toctree-l4"><a class="reference internal" href="../command/cloneCollectionAsCapped.html">cloneCollectionAsCapped</a></li><li class="toctree-l4"><a class="reference internal" href="../command/collMod.html">collMod</a></li><li class="toctree-l4"><a class="reference internal" href="../command/compact.html">compact</a></li><li class="toctree-l4"><a class="reference internal" href="../command/connPoolSync.html">connPoolSync</a></li><li class="toctree-l4"><a class="reference internal" href="../command/convertToCapped.html">convertToCapped</a></li><li class="toctree-l4"><a class="reference internal" href="../command/create.html">create</a></li><li class="toctree-l4"><a class="reference internal" href="../command/createIndexes.html">createIndexes</a></li><li class="toctree-l4"><a class="reference internal" href="../command/currentOp.html">currentOp</a></li><li class="toctree-l4"><a class="reference internal" href="../command/drop.html">drop</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dropDatabase.html">dropDatabase</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dropConnections.html">dropConnections</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dropIndexes.html">dropIndexes</a></li><li class="toctree-l4"><a class="reference internal" href="../command/filemd5.html">filemd5</a></li><li class="toctree-l4"><a class="reference internal" href="../command/fsync.html">fsync</a></li><li class="toctree-l4"><a class="reference internal" href="../command/fsyncUnlock.html">fsyncUnlock</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getParameter.html">getParameter</a></li><li class="toctree-l4"><a class="reference internal" href="../command/killCursors.html">killCursors</a></li><li class="toctree-l4"><a class="reference internal" href="../command/killOp.html">killOp</a></li><li class="toctree-l4"><a class="reference internal" href="../command/listCollections.html">listCollections</a></li><li class="toctree-l4"><a class="reference internal" href="../command/listDatabases.html">listDatabases</a></li><li class="toctree-l4"><a class="reference internal" href="../command/listIndexes.html">listIndexes</a></li><li class="toctree-l4"><a class="reference internal" href="../command/logRotate.html">logRotate</a></li><li class="toctree-l4"><a class="reference internal" href="../command/reIndex.html">reIndex</a></li><li class="toctree-l4"><a class="reference internal" href="../command/renameCollection.html">renameCollection</a></li><li class="toctree-l4"><a class="reference internal" href="../command/setFeatureCompatibilityVersion.html">setFeatureCompatibilityVersion</a></li><li class="toctree-l4"><a class="reference internal" href="../command/setParameter.html">setParameter</a></li><li class="toctree-l4"><a class="reference internal" href="../command/shutdown.html">shutdown</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-diagnostic.html">Diagnostic Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/availableQueryOptions.html">availableQueryOptions</a></li><li class="toctree-l4"><a class="reference internal" href="../command/buildInfo.html">buildInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../command/collStats.html">collStats</a></li><li class="toctree-l4"><a class="reference internal" href="../command/connPoolStats.html">connPoolStats</a></li><li class="toctree-l4"><a class="reference internal" href="../command/connectionStatus.html">connectionStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../command/cursorInfo.html">cursorInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dataSize.html">dataSize</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dbHash.html">dbHash</a></li><li class="toctree-l4"><a class="reference internal" href="../command/dbStats.html">dbStats</a></li><li class="toctree-l4"><a class="reference internal" href="../command/diagLogging.html">diagLogging</a></li><li class="toctree-l4"><a class="reference internal" href="../command/driverOIDTest.html">driverOIDTest</a></li><li class="toctree-l4"><a class="reference internal" href="../command/explain.html">explain</a></li><li class="toctree-l4"><a class="reference internal" href="../command/features.html">features</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getCmdLineOpts.html">getCmdLineOpts</a></li><li class="toctree-l4"><a class="reference internal" href="../command/getLog.html">getLog</a></li><li class="toctree-l4"><a class="reference internal" href="../command/hostInfo.html">hostInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../command/isSelf.html">isSelf</a></li><li class="toctree-l4"><a class="reference internal" href="../command/listCommands.html">listCommands</a></li><li class="toctree-l4"><a class="reference internal" href="../command/netstat.html">netstat</a></li><li class="toctree-l4"><a class="reference internal" href="../command/ping.html">ping</a></li><li class="toctree-l4"><a class="reference internal" href="../command/profile.html">profile</a></li><li class="toctree-l4"><a class="reference internal" href="../command/serverStatus.html">serverStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../command/shardConnPoolStats.html">shardConnPoolStats</a></li><li class="toctree-l4"><a class="reference internal" href="../command/top.html">top</a></li><li class="toctree-l4"><a class="reference internal" href="../command/validate.html">validate</a></li><li class="toctree-l4"><a class="reference internal" href="../command/whatsmyuri.html">whatsmyuri</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-free-monitoring.html">Free Monitoring Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/getFreeMonitoringStatus.html">getFreeMonitoringStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../command/setFreeMonitoring.html">setFreeMonitoring</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../command/nav-auditing.html">System Events Auditing Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../command/logApplicationMessage.html">logApplicationMessage</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../method.html"><code class="docutils literal"><span class="pre">mongo</span></code> Shell Methods</a><ul><li class="toctree-l3"><a class="reference internal" href="../method/js-collection.html">Collection Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.aggregate.html">db.collection.aggregate()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.bulkWrite.html">db.collection.bulkWrite()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.copyTo.html">db.collection.copyTo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.count.html">db.collection.count()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.countDocuments.html">db.collection.countDocuments()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.estimatedDocumentCount.html">db.collection.estimatedDocumentCount()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.createIndex.html">db.collection.createIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.createIndexes.html">db.collection.createIndexes()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.dataSize.html">db.collection.dataSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.deleteOne.html">db.collection.deleteOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.deleteMany.html">db.collection.deleteMany()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.distinct.html">db.collection.distinct()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.drop.html">db.collection.drop()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.dropIndex.html">db.collection.dropIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.dropIndexes.html">db.collection.dropIndexes()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.ensureIndex.html">db.collection.ensureIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.explain.html">db.collection.explain()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.find.html">db.collection.find()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.findAndModify.html">db.collection.findAndModify()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.findOne.html">db.collection.findOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.findOneAndDelete.html">db.collection.findOneAndDelete()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.findOneAndReplace.html">db.collection.findOneAndReplace()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.findOneAndUpdate.html">db.collection.findOneAndUpdate()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.getIndexes.html">db.collection.getIndexes()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.getShardDistribution.html">db.collection.getShardDistribution()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.getShardVersion.html">db.collection.getShardVersion()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.insert.html">db.collection.insert()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.insertOne.html">db.collection.insertOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.insertMany.html">db.collection.insertMany()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.isCapped.html">db.collection.isCapped()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.latencyStats.html">db.collection.latencyStats()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.mapReduce.html">db.collection.mapReduce()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.reIndex.html">db.collection.reIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.remove.html">db.collection.remove()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.renameCollection.html">db.collection.renameCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.replaceOne.html">db.collection.replaceOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.save.html">db.collection.save()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.stats.html">db.collection.stats()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.storageSize.html">db.collection.storageSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.totalIndexSize.html">db.collection.totalIndexSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.totalSize.html">db.collection.totalSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.update.html">db.collection.update()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.updateOne.html">db.collection.updateOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.updateMany.html">db.collection.updateMany()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.watch.html">db.collection.watch()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.validate.html">db.collection.validate()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-cursor.html">Cursor Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/cursor.addOption.html">cursor.addOption()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.allowPartialResults.html">cursor.allowPartialResults()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.batchSize.html">cursor.batchSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.close.html">cursor.close()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.isClosed.html">cursor.isClosed()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.collation.html">cursor.collation()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.comment.html">cursor.comment()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.count.html">cursor.count()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.explain.html">cursor.explain()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.forEach.html">cursor.forEach()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.hasNext.html">cursor.hasNext()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.hint.html">cursor.hint()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.isExhausted.html">cursor.isExhausted()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.itcount.html">cursor.itcount()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.limit.html">cursor.limit()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.map.html">cursor.map()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.max.html">cursor.max()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.maxTimeMS.html">cursor.maxTimeMS()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.min.html">cursor.min()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.next.html">cursor.next()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.noCursorTimeout.html">cursor.noCursorTimeout()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.objsLeftInBatch.html">cursor.objsLeftInBatch()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.pretty.html">cursor.pretty()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.readConcern.html">cursor.readConcern()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.readPref.html">cursor.readPref()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.returnKey.html">cursor.returnKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.showRecordId.html">cursor.showRecordId()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.size.html">cursor.size()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.skip.html">cursor.skip()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.sort.html">cursor.sort()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.tailable.html">cursor.tailable()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cursor.toArray.html">cursor.toArray()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-database.html">Database Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/db.adminCommand.html">db.adminCommand()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.aggregate.html">db.aggregate()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.cloneCollection.html">db.cloneCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.cloneDatabase.html">db.cloneDatabase()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.commandHelp.html">db.commandHelp()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.copyDatabase.html">db.copyDatabase()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.createCollection.html">db.createCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.createView.html">db.createView()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.currentOp.html">db.currentOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.dropDatabase.html">db.dropDatabase()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.eval.html">db.eval()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.fsyncLock.html">db.fsyncLock()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.fsyncUnlock.html">db.fsyncUnlock()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getCollection.html">db.getCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getCollectionInfos.html">db.getCollectionInfos()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getCollectionNames.html">db.getCollectionNames()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getLastError.html">db.getLastError()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getLastErrorObj.html">db.getLastErrorObj()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getLogComponents.html">db.getLogComponents()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getMongo.html">db.getMongo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getName.html">db.getName()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getProfilingLevel.html">db.getProfilingLevel()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getProfilingStatus.html">db.getProfilingStatus()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getReplicationInfo.html">db.getReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getSiblingDB.html">db.getSiblingDB()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.help.html">db.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.hostInfo.html">db.hostInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.isMaster.html">db.isMaster()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.killOp.html">db.killOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.listCommands.html">db.listCommands()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.logout.html">db.logout()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.printCollectionStats.html">db.printCollectionStats()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.printReplicationInfo.html">db.printReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.printShardingStatus.html">db.printShardingStatus()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.printSlaveReplicationInfo.html">db.printSlaveReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.resetError.html">db.resetError()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.runCommand.html">db.runCommand()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.serverBuildInfo.html">db.serverBuildInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.serverCmdLineOpts.html">db.serverCmdLineOpts()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.serverStatus.html">db.serverStatus()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.setLogLevel.html">db.setLogLevel()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.setProfilingLevel.html">db.setProfilingLevel()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.shutdownServer.html">db.shutdownServer()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.stats.html">db.stats()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.version.html">db.version()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.watch.html">db.watch()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-plan-cache.html">Query Plan Cache Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.getPlanCache.html">db.collection.getPlanCache()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/PlanCache.clear.html">PlanCache.clear()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/PlanCache.clearPlansByQuery.html">PlanCache.clearPlansByQuery()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/PlanCache.getPlansByQuery.html">PlanCache.getPlansByQuery()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/PlanCache.help.html">PlanCache.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/PlanCache.listQueryShapes.html">PlanCache.listQueryShapes()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-bulk.html">Bulk Operation Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.initializeOrderedBulkOp.html">db.collection.initializeOrderedBulkOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.collection.initializeUnorderedBulkOp.html">db.collection.initializeUnorderedBulkOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.html">Bulk()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.execute.html">Bulk.execute()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.html">Bulk.find()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.arrayFilters.html">Bulk.find.arrayFilters()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.collation.html">Bulk.find.collation()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.hint.html">Bulk.find.hint()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.remove.html">Bulk.find.remove()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.removeOne.html">Bulk.find.removeOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.replaceOne.html">Bulk.find.replaceOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.updateOne.html">Bulk.find.updateOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.update.html">Bulk.find.update()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.find.upsert.html">Bulk.find.upsert()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.getOperations.html">Bulk.getOperations()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.insert.html">Bulk.insert()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.tojson.html">Bulk.tojson()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Bulk.toString.html">Bulk.toString()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-user-management.html">User Management Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/db.auth.html">db.auth()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.changeUserPassword.html">db.changeUserPassword()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.createUser.html">db.createUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.dropUser.html">db.dropUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.dropAllUsers.html">db.dropAllUsers()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getUser.html">db.getUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getUsers.html">db.getUsers()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.grantRolesToUser.html">db.grantRolesToUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.removeUser.html">db.removeUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.revokeRolesFromUser.html">db.revokeRolesFromUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.updateUser.html">db.updateUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/passwordPrompt.html">passwordPrompt()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-role-management.html">Role Management Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/db.createRole.html">db.createRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.dropRole.html">db.dropRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.dropAllRoles.html">db.dropAllRoles()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getRole.html">db.getRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getRoles.html">db.getRoles()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.grantPrivilegesToRole.html">db.grantPrivilegesToRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.revokePrivilegesFromRole.html">db.revokePrivilegesFromRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.grantRolesToRole.html">db.grantRolesToRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.revokeRolesFromRole.html">db.revokeRolesFromRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.updateRole.html">db.updateRole()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-replication.html">Replication Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/rs.add.html">rs.add()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.addArb.html">rs.addArb()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.conf.html">rs.conf()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.freeze.html">rs.freeze()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.help.html">rs.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.initiate.html">rs.initiate()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.printReplicationInfo.html">rs.printReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.printSlaveReplicationInfo.html">rs.printSlaveReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.reconfig.html">rs.reconfig()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.remove.html">rs.remove()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.slaveOk.html">rs.slaveOk()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.status.html">rs.status()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.stepDown.html">rs.stepDown()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rs.syncFrom.html">rs.syncFrom()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-sharding.html">Sharding Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/sh.addShard.html">sh.addShard()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.addShardTag.html">sh.addShardTag()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.addShardToZone.html">sh.addShardToZone()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.addTagRange.html">sh.addTagRange()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.disableBalancing.html">sh.disableBalancing()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.enableBalancing.html">sh.enableBalancing()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.disableAutoSplit.html">sh.disableAutoSplit</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.enableAutoSplit.html">sh.enableAutoSplit</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.enableSharding.html">sh.enableSharding()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.getBalancerHost.html">sh.getBalancerHost()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.getBalancerState.html">sh.getBalancerState()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.removeTagRange.html">sh.removeTagRange()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.removeRangeFromZone.html">sh.removeRangeFromZone()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.help.html">sh.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.isBalancerRunning.html">sh.isBalancerRunning()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.moveChunk.html">sh.moveChunk()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.removeShardTag.html">sh.removeShardTag()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.removeShardFromZone.html">sh.removeShardFromZone()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.setBalancerState.html">sh.setBalancerState()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.shardCollection.html">sh.shardCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.splitAt.html">sh.splitAt()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.splitFind.html">sh.splitFind()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.startBalancer.html">sh.startBalancer()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.status.html">sh.status()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.stopBalancer.html">sh.stopBalancer()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.waitForBalancer.html">sh.waitForBalancer()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.waitForBalancerOff.html">sh.waitForBalancerOff()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.waitForPingChange.html">sh.waitForPingChange()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sh.updateZoneKeyRange.html">sh.updateZoneKeyRange()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/convertShardKeyToHashed.html">convertShardKeyToHashed</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-free-monitoring.html">Free Monitoring Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/db.disableFreeMonitoring.html">db.disableFreeMonitoring()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.enableFreeMonitoring.html">db.enableFreeMonitoring()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/db.getFreeMonitoringStatus.html">db.getFreeMonitoringStatus</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-constructor.html">Object Constructors and Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/BulkWriteResult.html">BulkWriteResult()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Date.html">Date()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/ObjectId.html">ObjectId</a></li><li class="toctree-l4"><a class="reference internal" href="../method/ObjectId.getTimestamp.html">ObjectId.getTimestamp()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/ObjectId.toString.html">ObjectId.toString()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/ObjectId.valueOf.html">ObjectId.valueOf()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/UUID.html">UUID()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/WriteResult.html">WriteResult()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/WriteResult.hasWriteError.html">WriteResult.hasWriteError()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/WriteResult.hasWriteConcernError.html">WriteResult.hasWriteConcernError()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-connection.html">Connection Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/connect.html">connect()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.html">Mongo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.getDB.html">Mongo.getDB()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.getReadPrefMode.html">Mongo.getReadPrefMode()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.getReadPrefTagSet.html">Mongo.getReadPrefTagSet()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.isCausalConsistency.html">Mongo.isCausalConsistency()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.setCausalConsistency.html">Mongo.setCausalConsistency()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.setReadPref.html">Mongo.setReadPref()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.setSlaveOk.html">Mongo.setSlaveOk()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.startSession.html">Mongo.startSession()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Mongo.watch.html">Mongo.watch()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/Session.html">Session</a><ul><li class="toctree-l5"><a class="reference internal" href="../method/Session.abortTransaction.html">Session.abortTransaction()</a></li><li class="toctree-l5"><a class="reference internal" href="../method/Session.commitTransaction.html">Session.commitTransaction()</a></li><li class="toctree-l5"><a class="reference internal" href="../method/Session.startTransaction.html">Session.startTransaction()</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../method/SessionOptions.html">SessionOptions</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-native.html">Native Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/cat.html">cat()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/cd.html">cd()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/copyDbpath.html">copyDbpath()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/getHostName.html">getHostName()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/getMemInfo.html">getMemInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/hostname.html">hostname()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/isInteractive.html">isInteractive()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/listFiles.html">listFiles()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/load.html">load()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/ls.html">ls()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/md5sumFile.html">md5sumFile()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/mkdir.html">mkdir()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/pwd.html">pwd()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/quit.html">quit()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/removeFile.html">removeFile()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/resetDbpath.html">resetDbpath()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/sleep.html">sleep()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/setVerboseShell.html">setVerboseShell()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/version.html">version()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/isWindows.html">_isWindows()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/rand.html">_rand()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../method/js-client-side-field-level-encryption.html">Client-Side Field Level Encryption Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../method/getKeyVault.html">getKeyVault()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/KeyVault.createKey.html">KeyVault.createKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/KeyVault.deleteKey.html">KeyVault.deleteKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/KeyVault.getKey.html">KeyVault.getKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/KeyVault.getKeys.html">KeyVault.getKeys()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/KeyVault.addKeyAlternateName.html">KeyVault.addKeyAlternateName()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/KeyVault.removeKeyAlternateName.html">KeyVault.removeKeyAlternateName()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/KeyVault.getKeyByAltName.html">KeyVault.getKeyByAltName()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/getClientEncryption.html">getClientEncryption()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/ClientEncryption.encrypt.html">ClientEncryption.encrypt()</a></li><li class="toctree-l4"><a class="reference internal" href="../method/ClientEncryption.decrypt.html">ClientEncryption.decrypt()</a></li></ul></li></ul></li><li class="toctree-l2 current"><a class="reference internal" href="../program.html">MongoDB Package Components</a><ul class="current"><li class="toctree-l3"><a class="reference internal" href="mongod.html"><code class="docutils literal"><span class="pre">mongod</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongos.html"><code class="docutils literal"><span class="pre">mongos</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongo.html"><code class="docutils literal"><span class="pre">mongo</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongod.exe.html"><code class="docutils literal"><span class="pre">mongod.exe</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongos.exe.html"><code class="docutils literal"><span class="pre">mongos.exe</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongodump.html"><code class="docutils literal"><span class="pre">mongodump</span></code></a></li><li class="toctree-l3 current"><a class="reference internal current" href=""><code class="docutils literal"><span class="pre">mongorestore</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="bsondump.html"><code class="docutils literal"><span class="pre">bsondump</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongoimport.html"><code class="docutils literal"><span class="pre">mongoimport</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongoexport.html"><code class="docutils literal"><span class="pre">mongoexport</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongostat.html"><code class="docutils literal"><span class="pre">mongostat</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongotop.html"><code class="docutils literal"><span class="pre">mongotop</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongoreplay.html"><code class="docutils literal"><span class="pre">mongoreplay</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongoldap.html"><code class="docutils literal"><span class="pre">mongoldap</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="mongofiles.html"><code class="docutils literal"><span class="pre">mongofiles</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="install_compass.html"><code class="docutils literal"><span class="pre">install_compass</span></code></a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../configuration-options.html">Configuration File Options</a><ul><li class="toctree-l3"><a class="reference internal" href="../expansion-directives.html">Externally Sourced Configuration File Values</a></li><li class="toctree-l3"><a class="reference internal" href="../../tutorial/convert-command-line-options-to-yaml.html">Convert Command-Line Options to YAML</a></li><li class="toctree-l3"><a class="reference internal" href="../configuration-file-settings-command-line-options-mapping.html">Configuration File Settings and Command-Line Options Mapping</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../parameters.html">MongoDB Server Parameters</a></li><li class="toctree-l2"><a class="reference internal" href="../limits.html">MongoDB Limits and Thresholds</a></li><li class="toctree-l2"><a class="reference internal" href="../explain-results.html">Explain Results</a></li><li class="toctree-l2"><a class="reference internal" href="../system-collections.html">System Collections</a></li><li class="toctree-l2"><a class="reference internal" href="../connection-string.html">Connection String URI Format</a></li><li class="toctree-l2"><a class="reference internal" href="../collation.html">Collation</a><ul><li class="toctree-l3"><a class="reference internal" href="../collation-locales-defaults.html">Collation Locales and Default Parameters</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../mongodb-wire-protocol.html">MongoDB Wire Protocol</a></li><li class="toctree-l2"><a class="reference internal" href="../log-messages.html">Log Messages</a></li><li class="toctree-l2"><a class="reference internal" href="../exit-codes.html">Exit Codes and Statuses</a></li><li class="toctree-l2"><a class="reference internal" href="../glossary.html">Glossary</a></li><li class="toctree-l2"><a class="reference internal" href="../default-mongodb-port.html">Default MongoDB Port</a></li><li class="toctree-l2"><a class="reference internal" href="../server-sessions.html">Server Sessions</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../release-notes.html">Release Notes</a><ul><li class="toctree-l2"><a class="reference internal" href="../../release-notes/4.2.html">Release Notes for MongoDB 4.2</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.2-compatibility.html">Compatibility Changes in MongoDB 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.2-upgrade-standalone.html">Upgrade a Standalone to 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.2-upgrade-replica-set.html">Upgrade a Replica Set to 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.2-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.2-downgrade.html">Downgrade 4.2 to 4.0</a><ul><li class="toctree-l4"><a class="reference internal" href="../../release-notes/4.2-downgrade-standalone.html">Downgrade 4.2 Standalone to 4.0</a></li><li class="toctree-l4"><a class="reference internal" href="../../release-notes/4.2-downgrade-replica-set.html">Downgrade 4.2 Replica Set to 4.0</a></li><li class="toctree-l4"><a class="reference internal" href="../../release-notes/4.2-downgrade-sharded-cluster.html">Downgrade 4.2 Sharded Cluster to 4.0</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.2-changelog.html">4.2 Changelog</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/4.0.html">Release Notes for MongoDB 4.0</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-compatibility.html">Compatibility Changes in MongoDB 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-upgrade-standalone.html">Upgrade a Standalone to 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-upgrade-replica-set.html">Upgrade a Replica Set to 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-downgrade-standalone.html">Downgrade 4.0 Standalone to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-downgrade-replica-set.html">Downgrade 4.0 Replica Set to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-downgrade-sharded-cluster.html">Downgrade 4.0 Sharded Cluster to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/4.0-changelog.html">4.0 Changelog</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/3.6.html">Release Notes for MongoDB 3.6</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-changelog.html">3.6 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-compatibility.html">Compatibility Changes in MongoDB 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-upgrade-standalone.html">Upgrade a Standalone to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-upgrade-replica-set.html">Upgrade a Replica Set to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-downgrade-standalone.html">Downgrade 3.6 Standalone to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-downgrade-replica-set.html">Downgrade 3.6 Replica Set to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.6-downgrade-sharded-cluster.html">Downgrade 3.6 Sharded Cluster to 3.4</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/3.4.html">Release Notes for MongoDB 3.4</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.4-changelog.html">3.4 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.4-compatibility.html">Compatibility Changes in MongoDB 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.4-upgrade-standalone.html">Upgrade a Standalone to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.4-upgrade-replica-set.html">Upgrade a Replica Set to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.4-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.4-downgrade.html">Downgrade MongoDB 3.4 to 3.2</a><ul><li class="toctree-l4"><a class="reference internal" href="../../release-notes/3.4-downgrade-standalone.html">Downgrade 3.4 Standalone to 3.2</a></li><li class="toctree-l4"><a class="reference internal" href="../../release-notes/3.4-downgrade-replica-set.html">Downgrade 3.4 Replica Set to 3.2</a></li><li class="toctree-l4"><a class="reference internal" href="../../release-notes/3.4-downgrade-sharded-cluster.html">Downgrade 3.4 Sharded Cluster to 3.2</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/3.2.html">Release Notes for MongoDB 3.2</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.2-changelog.html">3.2 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.2-compatibility.html">Compatibility Changes in MongoDB 3.2</a><ul><li class="toctree-l4"><a class="reference internal" href="../../release-notes/3.2-javascript.html">JavaScript Changes in MongoDB 3.2</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.2-upgrade.html">Upgrade MongoDB to 3.2</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.2-downgrade.html">Downgrade MongoDB from 3.2</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/3.0.html">Release Notes for MongoDB 3.0</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.0-changelog.html">3.0 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.0-compatibility.html">Compatibility Changes in MongoDB 3.0</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.0-upgrade.html">Upgrade MongoDB to 3.0</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.0-scram.html">Upgrade to SCRAM</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/3.0-downgrade.html">Downgrade MongoDB from 3.0</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/2.6.html">Release Notes for MongoDB 2.6</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.6-changelog.html">2.6 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.6-compatibility.html">Compatibility Changes in MongoDB 2.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.6-upgrade.html">Upgrade MongoDB to 2.6</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.6-upgrade-authorization.html">Upgrade User Authorization Data to 2.6 Format</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.6-downgrade.html">Downgrade MongoDB from 2.6</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/2.4.html">Release Notes for MongoDB 2.4</a><ul><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.4-changelog.html">2.4 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.4-javascript.html">JavaScript Changes in MongoDB 2.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.4-upgrade.html">Upgrade MongoDB to 2.4</a></li><li class="toctree-l3"><a class="reference internal" href="../../release-notes/2.4-index-types.html">Compatibility and Index Type Changes in MongoDB 2.4</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/2.2.html">Release Notes for MongoDB 2.2</a></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/2.0.html">Release Notes for MongoDB 2.0</a></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/1.8.html">Release Notes for MongoDB 1.8</a></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/1.6.html">Release Notes for MongoDB 1.6</a></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/1.4.html">Release Notes for MongoDB 1.4</a></li><li class="toctree-l2"><a class="reference internal" href="../../release-notes/1.2.html">Release Notes for MongoDB 1.2.x</a></li><li class="toctree-l2"><a class="reference internal" href="../versioning.html">MongoDB Versioning</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../../support.html">Technical Support</a></li></ul>


    </div>
  </div>
           
         </aside>

   </div>

    <div id="main-column" class="main-column">

    <span id="showNav" class="showNav">Navigation</span>

      
        <div class="document">
            <div class="documentwrapper"><div class="bodywrapper">
              <div class="body" data-pagename="reference/program/mongorestore">
                   <a class="edit-link" href="https://github.com/mongodb/docs/blob/v4.2/source/reference/program/mongorestore.txt" target="_blank" title="Edit reference/program/mongorestore.txt on GitHub">
    
      <span class="icon-edit"></span>
    
  </a>
                

                
  <div class="bc">
    
      <ul>
          <li><a href="../../reference.html">Reference</a><span class="bcpoint"> > </span></li>
            
          <li><a href="../program.html">MongoDB Package Components</a><span class="bcpoint"> > </span></li>
            <li><code class="docutils literal"><span class="pre">mongorestore</span></code></li> 
      </ul>
    
    
  </div>
                
                  <div class="section" id="mongorestore">
<span id="id1"></span><h1><code class="docutils literal"><span class="pre">mongorestore</span></code><a class="headerlink" href="#mongorestore" title="Permalink to this headline">¶</a></h1>
<div class="contents singlecol local topic" id="on-this-page">
<p class="topic-title first">On this page</p>
<ul class="simple">
<li><a class="reference internal" href="#synopsis" id="id3">Synopsis</a></li>
<li><a class="reference internal" href="#availability" id="id4">Availability</a></li>
<li><a class="reference internal" href="#usage-in-backup-strategy" id="id5">Usage in Backup Strategy</a></li>
<li><a class="reference internal" href="#syntax" id="id6">Syntax</a></li>
<li><a class="reference internal" href="#behavior" id="id7">Behavior</a></li>
<li><a class="reference internal" href="#required-access" id="id8">Required Access</a></li>
<li><a class="reference internal" href="#options" id="id9">Options</a></li>
<li><a class="reference internal" href="#examples" id="id10">Examples</a></li>
</ul>
</div>
<div class="admonition-macos-sierra-and-go-1-6-incompatibility admonition">
<p class="first admonition-title">macOS Sierra and Go 1.6 Incompatibility</p>
<p class="last">Users running on macOS Sierra require the 3.2.10 or newer version
of  <code class="docutils literal"><span class="pre">mongorestore</span></code>.</p>
</div>
<div class="note admonition">
<p class="first admonition-title">Upcoming Tools Migration in MongoDB 4.4</p>
<p>Starting in MongoDB 4.4, the <code class="docutils literal"><span class="pre">mongorestore</span></code> documentation
migrates to <a class="reference external" href="https://docs.mongodb.com/database-tools/mongorestore">MongoDB Database Tools - mongorestore</a>. Refer to
that page for more information on the upcoming version of
<code class="docutils literal"><span class="pre">mongorestore</span></code> (tool version 100.0.0).</p>
<p class="last">The documentation on this page only applies to the MongoDB 4.2
version of <code class="docutils literal"><span class="pre">mongorestore</span></code>. The MongoDB 4.2 version of
<code class="docutils literal"><span class="pre">mongorestore</span></code> is available for download following the instructions
in the <a class="reference internal" href="#mongorestore-availability"><span class="std std-ref">Availability</span></a> section below.</p>
</div>
<div class="section" id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> program loads data from either a binary
database dump created by <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> or the standard input
(starting in version 3.0.0) into a <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> or
<a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instance.</p>
</div>
<div class="section" id="availability">
<span id="mongorestore-availability"></span><h2>Availability<a class="headerlink" href="#availability" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> tool is part of the MongoDB tools package. Consult the
<a class="reference internal" href="../../installation.html#tutorial-installation"><span class="std std-ref">installation guide</span></a> for your platform for
instructions on how to install the tools package as part of your
MongoDB installation.</p>
<p>The tools package is also available from the
<a class="reference external" href="https://www.mongodb.com/download-center/community?jmp=docs">MongoDB Download Center</a>,
either as a separate <code class="docutils literal"><span class="pre">tools</span></code> download, or contained within the
<code class="docutils literal"><span class="pre">TGZ</span></code> or <code class="docutils literal"><span class="pre">ZIP</span></code> downloads, depending on platform. On Windows, the <code class="docutils literal"><span class="pre">MSI</span></code> installer includes all tools as part of the default installation.</p>
<div class="admonition-tip admonition">
<p class="first admonition-title">Tip</p>
<p class="last">If downloading the <code class="docutils literal"><span class="pre">TGZ</span></code> or <code class="docutils literal"><span class="pre">ZIP</span></code> files from the Download
Center, you may want to update your <code class="docutils literal"><span class="pre">PATH</span></code> environment
variable to include the directory where you installed these tools.
See the <a class="reference internal" href="../../installation.html#tutorial-installation"><span class="std std-ref">installation guide</span></a>
for your platform for more information.</p>
</div>
</div>
<div class="section" id="usage-in-backup-strategy">
<h2>Usage in Backup Strategy<a class="headerlink" href="#usage-in-backup-strategy" title="Permalink to this headline">¶</a></h2>
<div class="section" id="standalones-replica-sets">
<h3>Standalones/Replica Sets<a class="headerlink" href="#standalones-replica-sets" title="Permalink to this headline">¶</a></h3>
<p>For an overview of <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> usage as part of a
backup and recovery strategy, see
<a class="reference internal" href="../../tutorial/backup-and-restore-tools.html"><span class="doc">Back Up and Restore with MongoDB Tools</span></a>.</p>
</div>
<div class="section" id="sharded-clusters">
<h3>Sharded Clusters<a class="headerlink" href="#sharded-clusters" title="Permalink to this headline">¶</a></h3>
<p><a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> and <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>
<strong class="text-danger">cannot</strong> be part of a backup strategy for 4.2+ sharded clusters
that have sharded transactions in progress, as backups created with
<a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> <em>do not maintain</em> the atomicity guarantees
of transactions across shards.</p>
<p>For 4.2+ sharded clusters with in-progress sharded transactions, use
one of the following coordinated backup and restore processes which
<em>do maintain</em> the atomicity guarantees of transactions across shards:</p>
<ul class="simple">
<li><a class="reference external" href="https://www.mongodb.com/cloud/atlas?tck=docs_server">MongoDB Atlas</a>,</li>
<li><a class="reference external" href="https://www.mongodb.com/cloud/cloud-manager?jmp=docs">MongoDB Cloud Manager</a>, or</li>
<li><a class="reference external" href="https://www.mongodb.com/products/ops-manager?jmp=docs">MongoDB Ops Manager</a>.</li>
</ul>
</div>
</div>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<p>Run <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> from the system command line, not the <a class="reference internal" href="mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore <span class="o">[</span>options<span class="o">]</span> <span class="o">[</span>&lt;directory&gt;/&lt;BSON file&gt;<span class="o">]</span>
</pre></div>
</div>
</div>
<p>For example, to restore from a <code class="docutils literal"><span class="pre">dump</span></code> directory to a local
<a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> instance running on port <code class="docutils literal"><span class="pre">27017</span></code>:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore  dump/
</pre></div>
</div>
</div>
<p>As <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> restores from the <code class="docutils literal"><span class="pre">dump/</span></code> directory,
it creates the database and collections as needed and logs its progress:</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="m">2019</span>-07-08T14:37:38.942-0400 preparing collections to restore from
<span class="m">2019</span>-07-08T14:37:38.944-0400 reading metadata <span class="k">for</span> test.bakesales from dump/test/bakesales.metadata.json
<span class="m">2019</span>-07-08T14:37:38.944-0400 reading metadata <span class="k">for</span> test.salaries from dump/test/salaries.metadata.json
<span class="m">2019</span>-07-08T14:37:38.976-0400 restoring test.salaries from dump/test/salaries.bson
<span class="m">2019</span>-07-08T14:37:38.985-0400 no indexes to restore
<span class="m">2019</span>-07-08T14:37:38.985-0400 finished restoring test.salaries <span class="o">(</span><span class="m">10</span> documents, <span class="m">0</span> failures<span class="o">)</span>
<span class="m">2019</span>-07-08T14:37:39.009-0400 restoring test.bakesales from dump/test/bakesales.bson
<span class="m">2019</span>-07-08T14:37:39.011-0400 restoring indexes <span class="k">for</span> collection test.bakesales from metadata
<span class="m">2019</span>-07-08T14:37:39.118-0400 finished restoring test.bakesales <span class="o">(</span><span class="m">21</span> documents, <span class="m">0</span> failures<span class="o">)</span>
<span class="m">2019</span>-07-08T14:37:39.118-0400 restoring users from dump/admin/system.users.bson
<span class="m">2019</span>-07-08T14:37:39.163-0400 restoring roles from dump/admin/system.roles.bson
<span class="m">2019</span>-07-08T14:37:39.249-0400 <span class="m">31</span> document<span class="o">(</span>s<span class="o">)</span> restored successfully. <span class="m">0</span> document<span class="o">(</span>s<span class="o">)</span> failed to restore.
</pre></div>
</div>
</div>
<p>You can also restore a specific collection or collections from the
<code class="docutils literal"><span class="pre">dump/</span></code> directory. For example, the following operation restores a
single collection from corresponding data files in the <code class="docutils literal"><span class="pre">dump/</span></code>
directory:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --nsInclude<span class="o">=</span>test.purchaseorders dump/
</pre></div>
</div>
</div>
<p>If the <code class="docutils literal"><span class="pre">dump/</span></code> directory does not contain the corresponding data file
for the specified namespace, no data will be restored. For example, the
following specifies a collection namespace that does not have a
corresponding data in the <code class="docutils literal"><span class="pre">dump/</span></code> directory:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --nsInclude<span class="o">=</span>foo.bar dump/
</pre></div>
</div>
</div>
<p>The <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> outputs the following messages:</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="m">2019</span>-07-08T14:38:15.142-0400 preparing collections to restore from
<span class="m">2019</span>-07-08T14:38:15.142-0400 <span class="m">0</span> document<span class="o">(</span>s<span class="o">)</span> restored successfully. <span class="m">0</span> document<span class="o">(</span>s<span class="o">)</span> failed to restore.
</pre></div>
</div>
</div>
<p>For more examples, see <a class="reference internal" href="#mongorestore-examples"><span class="std std-ref">Examples</span></a>.</p>
<p>For more information on the options and arguments, see
<a class="reference internal" href="#mongorestore-options"><span class="std std-ref">Options</span></a>.</p>
</div>
<div class="section" id="behavior">
<h2>Behavior<a class="headerlink" href="#behavior" title="Permalink to this headline">¶</a></h2>
<div class="section" id="insert-only">
<h3>Insert Only<a class="headerlink" href="#insert-only" title="Permalink to this headline">¶</a></h3>
<p><a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> can create a new database or add data to an
existing database. However, <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> performs inserts
only and does not perform updates. That is, if restoring documents to
an existing database and collection and existing documents have the
same value <code class="docutils literal"><span class="pre">_id</span></code> field as the to-be-restored documents,
<a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> will <em>not</em> overwrite those documents.</p>
</div>
<div class="section" id="rebuild-indexes">
<h3>Rebuild Indexes<a class="headerlink" href="#rebuild-indexes" title="Permalink to this headline">¶</a></h3>
<p><a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> recreates indexes recorded by
<a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>For MongoDB 2.6 through MongoDB versions with
<code class="docutils literal"><span class="pre">featureCompatibilityVersion</span></code> (fCV) set to <code class="docutils literal"><span class="pre">&quot;4.0&quot;</span></code> or earlier,
creating indexes will <a class="reference internal" href="../limits.html#Index-Key-Limit" title="Index Key Limit"><code class="xref mongodb mongodb-limit docutils literal"><span class="pre">error</span> <span class="pre">if</span> <span class="pre">an</span>
<span class="pre">index</span> <span class="pre">key</span> <span class="pre">in</span> <span class="pre">an</span> <span class="pre">existing</span> <span class="pre">document</span> <span class="pre">exceeds</span> <span class="pre">the</span> <span class="pre">limit</span></code></a>.</p>
<p class="last">To avoid this issue, consider using hashed indexes or indexing a
computed value instead. If you want to resolve the index issue after
restoring the data, you can disable the default index key length
validation on the target database by setting the <strong class="program">mongod</strong>
instance’s <a class="reference internal" href="../parameters.html#param.failIndexKeyTooLong" title="failIndexKeyTooLong"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">failIndexKeyTooLong</span></code></a> parameter to false.</p>
</div>
</div>
<div class="section" id="version-compatibility">
<h3>Version Compatibility<a class="headerlink" href="#version-compatibility" title="Permalink to this headline">¶</a></h3>
<p>The data format used by <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> from version 2.2 or
later is <em>incompatible</em> with earlier versions of <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>.
Do not use recent versions of <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> to back up older
data stores.</p>
</div>
<div class="section" id="exclude-system-profile-collection">
<h3>Exclude <code class="docutils literal"><span class="pre">system.profile</span></code> Collection<a class="headerlink" href="#exclude-system-profile-collection" title="Permalink to this headline">¶</a></h3>
<p><a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> does not restore the <a class="reference internal" href="../system-collections.html#&lt;database&gt;.system.profile" title="&lt;database&gt;.system.profile"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">system.profile</span></code></a> collection data.</p>
</div>
<div class="section" id="fips">
<h3>FIPS<a class="headerlink" href="#fips" title="Permalink to this headline">¶</a></h3>
<p>Starting in version 4.2, MongoDB removes the <code class="docutils literal"><span class="pre">--sslFIPSMode</span></code>
option for <code class="docutils literal"><span class="pre">mongorestore</span></code>. <code class="docutils literal"><span class="pre">mongorestore</span></code>
will use FIPS compliant connections to
<a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>/<a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> if the
<a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>/<a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instances are
<a class="reference internal" href="../../tutorial/configure-fips.html"><span class="doc">configured to use FIPS mode</span></a>.</p>
</div>
<div class="section" id="write-concern">
<h3>Write Concern<a class="headerlink" href="#write-concern" title="Permalink to this headline">¶</a></h3>
<p>Starting in version 4.2, if you specify write concern in both the
<a class="reference internal" href="#cmdoption-mongorestore-writeconcern"><code class="xref std std-option docutils literal"><span class="pre">--writeConcern</span></code></a> option and the
<a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a> connection string option, the
<a class="reference internal" href="#cmdoption-mongorestore-writeconcern"><code class="xref std std-option docutils literal"><span class="pre">--writeConcern</span></code></a> value overrides
the write concern specified in the URI string.</p>
<p>In earlier versions, the two options are incompatible.</p>
</div>
</div>
<div class="section" id="required-access">
<span id="mongorestore-required-access"></span><h2>Required Access<a class="headerlink" href="#required-access" title="Permalink to this headline">¶</a></h2>
<p>To restore data to a MongoDB deployment that has <a class="reference internal" href="../../core/authorization.html"><span class="doc">access control</span></a> enabled, the <a class="reference internal" href="../built-in-roles.html#restore" title="restore"><code class="xref mongodb mongodb-authrole docutils literal"><span class="pre">restore</span></code></a> role provides
the necessary privileges to restore data from backups <em>if</em> the data does
not include <a class="reference internal" href="../system-collections.html#&lt;database&gt;.system.profile" title="&lt;database&gt;.system.profile"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">system.profile</span></code></a>
collection data and you run <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> without the
<a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a> option.</p>
<p>If the backup data includes <a class="reference internal" href="../system-collections.html#&lt;database&gt;.system.profile" title="&lt;database&gt;.system.profile"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">system.profile</span></code></a> collection data or you run with
<a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a>, you need
additional privileges:</p>
<div class="docutils container">
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">system.profile</span></code></td>
<td><p class="first">If the backup data includes <a class="reference internal" href="../system-collections.html#&lt;database&gt;.system.profile" title="&lt;database&gt;.system.profile"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">system.profile</span></code></a> collection data and the target database
does not contain the <a class="reference internal" href="../system-collections.html#&lt;database&gt;.system.profile" title="&lt;database&gt;.system.profile"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">system.profile</span></code></a>
collection, <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> attempts to create the collection
even though the program does not actually restore <code class="docutils literal"><span class="pre">system.profile</span></code>
documents. As such, the user requires additional privileges to perform
<a class="reference internal" href="../privilege-actions.html#createCollection" title="createCollection"><code class="xref mongodb mongodb-authaction docutils literal"><span class="pre">createCollection</span></code></a> and <a class="reference internal" href="../privilege-actions.html#convertToCapped" title="convertToCapped"><code class="xref mongodb mongodb-authaction docutils literal"><span class="pre">convertToCapped</span></code></a>
actions on the <a class="reference internal" href="../system-collections.html#&lt;database&gt;.system.profile" title="&lt;database&gt;.system.profile"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">system.profile</span></code></a>
collection for a database.</p>
<p class="last">Both the built-in roles <a class="reference internal" href="../built-in-roles.html#dbAdmin" title="dbAdmin"><code class="xref mongodb mongodb-authrole docutils literal"><span class="pre">dbAdmin</span></code></a> and
<a class="reference internal" href="../built-in-roles.html#dbAdminAnyDatabase" title="dbAdminAnyDatabase"><code class="xref mongodb mongodb-authrole docutils literal"><span class="pre">dbAdminAnyDatabase</span></code></a> provide the additional privileges.</p>
</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">--oplogReplay</span></code></td>
<td><p class="first">To run with <a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a>, create a <a class="reference internal" href="../../tutorial/manage-users-and-roles.html#create-user-defined-role"><span class="std std-ref">user-defined role</span></a> that has <a class="reference internal" href="../privilege-actions.html#anyAction" title="anyAction"><code class="xref mongodb mongodb-authaction docutils literal"><span class="pre">anyAction</span></code></a> on
<a class="reference internal" href="../resource-document.html#resource-anyresource"><span class="std std-ref">anyResource</span></a>.</p>
<p class="last">Grant only to users who must run <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>
with <a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="options">
<span id="mongorestore-options"></span><h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
<dl class="binary">
<dt id="bin.mongorestore">
<code class="descname">mongorestore</code><a class="headerlink" href="#bin.mongorestore" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-help">
<code class="descname">--help</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-help" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns information on the options and use of <strong class="program">mongorestore</strong>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-verbose">
<code class="descname">--verbose</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-v</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-verbose" title="Permalink to this definition">¶</a></dt>
<dd><p>Increases the amount of internal reporting returned on standard output
or in log files. Increase the verbosity with the <code class="docutils literal"><span class="pre">-v</span></code> form by
including the option multiple times, (e.g. <code class="docutils literal"><span class="pre">-vvvvv</span></code>.)</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-quiet">
<code class="descname">--quiet</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-quiet" title="Permalink to this definition">¶</a></dt>
<dd><p>Runs <strong class="program">mongorestore</strong> in a quiet mode that attempts to limit the amount
of output.</p>
<p>This option suppresses:</p>
<ul class="simple">
<li>output from <a class="reference internal" href="../glossary.html#term-database-command"><span class="xref std std-term">database commands</span></a></li>
<li>replication activity</li>
<li>connection accepted events</li>
<li>connection closed events</li>
</ul>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-version">
<code class="descname">--version</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-version" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the <strong class="program">mongorestore</strong> release number.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-uri">
<code class="descname">--uri</code><code class="descclassname">=&lt;connectionString&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-uri" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.4.6.</span></p>
</div>
<p>Specify a resolvable <a class="reference internal" href="../connection-string.html"><span class="doc">URI</span></a>
connection string (enclose in quotes) to connect to the MongoDB deployment.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-none"><div class="highlight"><pre><span></span>--uri=&quot;mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]&quot;
</pre></div>
</div>
</div>
<p>For information on the components of the connection string, see
the <a class="reference internal" href="../connection-string.html"><span class="doc">Connection String URI Format</span></a> documentation.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For TLS/SSL options, use the command-line options instead of the
<a class="reference internal" href="../connection-string.html#uri-options-tls"><span class="std std-ref">URI options for TLS/SSL (Available starting in
4.2)</span></a>.</p>
</div>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p>The following command-line options cannot be used in conjunction
with <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a> option:</p>
<ul class="simple">
<li><a class="reference internal" href="#cmdoption-mongorestore-host"><code class="xref std std-option docutils literal"><span class="pre">--host</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-port"><code class="xref std std-option docutils literal"><span class="pre">--port</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-db"><code class="xref std std-option docutils literal"><span class="pre">--db</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-username"><code class="xref std std-option docutils literal"><span class="pre">--username</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-password"><code class="xref std std-option docutils literal"><span class="pre">--password</span></code></a>  (if the
<a class="reference internal" href="../connection-string.html"><span class="doc">URI</span></a> connection string also includes the password)</li>
<li><a class="reference internal" href="#cmdoption-mongorestore-authenticationdatabase"><code class="xref std std-option docutils literal"><span class="pre">--authenticationDatabase</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-authenticationmechanism"><code class="xref std std-option docutils literal"><span class="pre">--authenticationMechanism</span></code></a></li>
</ul>
<p class="last">Instead, specify these options as part of your <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>
connection string.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-host">
<code class="descname">--host</code><code class="descclassname">=&lt;hostname&gt;&lt;:port&gt;</code><code class="descclassname">, </code><code class="descname">-h</code><code class="descclassname">=&lt;hostname&gt;&lt;:port&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-host" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Default</em>: localhost:27017</p>
<p>Specifies a resolvable hostname for the <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> to which to
connect. By default, the <strong class="program">mongorestore</strong> attempts to connect to a MongoDB
instance running on the localhost on port number <code class="docutils literal"><span class="pre">27017</span></code>.</p>
<p>To connect to a replica set, specify the
<a class="reference internal" href="../configuration-options.html#replication.replSetName" title="replication.replSetName"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">replSetName</span></code></a> and a seed list of set members, as in
the following:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-none"><div class="highlight"><pre><span></span>--host=&lt;replSetName&gt;/&lt;hostname1&gt;&lt;:port&gt;,&lt;hostname2&gt;&lt;:port&gt;,&lt;...&gt;
</pre></div>
</div>
</div>
<p>When specifying the replica set list format, <strong class="program">mongorestore</strong> always connects to
the <a class="reference internal" href="../glossary.html#term-primary"><span class="xref std std-term">primary</span></a>.</p>
<p>You can also connect to any single member of the replica set by specifying
the host and port of only that member:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-none"><div class="highlight"><pre><span></span>--host=&lt;hostname1&gt;&lt;:port&gt;
</pre></div>
</div>
</div>
<p>If you use IPv6 and use the <code class="docutils literal"><span class="pre">&lt;address&gt;:&lt;port&gt;</span></code> format, you must
enclose the portion of an address and port combination in
brackets (e.g. <code class="docutils literal"><span class="pre">[&lt;address&gt;]</span></code>).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You cannot specify both <a class="reference internal" href="#cmdoption-mongorestore-host"><code class="xref std std-option docutils literal"><span class="pre">--host</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-port">
<code class="descname">--port</code><code class="descclassname">=&lt;port&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-port" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Default</em>: 27017</p>
<p>Specifies the TCP port on which the MongoDB instance listens for
client connections.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You cannot specify both <a class="reference internal" href="#cmdoption-mongorestore-port"><code class="xref std std-option docutils literal"><span class="pre">--port</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-ssl">
<code class="descname">--ssl</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-ssl" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables connection to a <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> or <a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> that has
TLS/SSL support enabled.</p>
<p>For more information about TLS/SSL and MongoDB, see
<a class="reference internal" href="../../tutorial/configure-ssl.html"><span class="doc">Configure mongod and mongos for TLS/SSL</span></a> and
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html"><span class="doc">TLS/SSL Configuration for Clients</span></a> .</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-sslcafile">
<code class="descname">--sslCAFile</code><code class="descclassname">=&lt;filename&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-sslcafile" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the <code class="file docutils literal"><span class="pre">.pem</span></code> file that contains the root certificate chain
from the Certificate Authority. Specify the file name of the
<code class="file docutils literal"><span class="pre">.pem</span></code> file using relative or absolute paths.</p>
<p>Starting in version 3.4, if <code class="docutils literal"><span class="pre">--tlsCAFile</span></code>/<code class="docutils literal"><span class="pre">net.tls.CAFile</span></code> (or
their aliases <code class="docutils literal"><span class="pre">--sslCAFile</span></code>/<code class="docutils literal"><span class="pre">net.ssl.CAFile</span></code>) is not specified
and you are not using x.509 authentication, the system-wide CA
certificate store will be used when connecting to an TLS/SSL-enabled
server.</p>
<p>To use x.509 authentication, <code class="docutils literal"><span class="pre">--tlsCAFile</span></code> or <code class="docutils literal"><span class="pre">net.tls.CAFile</span></code>
must be specified unless using <code class="docutils literal"><span class="pre">--tlsCertificateSelector</span></code> or
<code class="docutils literal"><span class="pre">--net.tls.certificateSelector</span></code>. Or if using the <code class="docutils literal"><span class="pre">ssl</span></code> aliases,
<code class="docutils literal"><span class="pre">--sslCAFile</span></code> or <code class="docutils literal"><span class="pre">net.ssl.CAFile</span></code> must be specified unless using
<code class="docutils literal"><span class="pre">--sslCertificateSelector</span></code> or <code class="docutils literal"><span class="pre">net.ssl.certificateSelector</span></code>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last"><strong>Version 3.2 and earlier:</strong> For TLS/SSL connections (<code class="docutils literal"><span class="pre">--ssl</span></code>) to
<a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and <a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a>, if the <strong class="program">mongorestore</strong> runs without the
<a class="reference internal" href="#cmdoption-mongorestore-sslcafile"><code class="xref std std-option docutils literal"><span class="pre">--sslCAFile</span></code></a>, <strong class="program">mongorestore</strong> will not attempt
to validate the server certificates. This creates a vulnerability
to expired <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and <a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> certificates as
well as to foreign processes posing as valid <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> or
<a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instances. Ensure that you <em>always</em> specify the
CA file to validate the server certificates in cases where
intrusion is a possibility.</p>
</div>
<p>For more information about TLS/SSL and MongoDB, see
<a class="reference internal" href="../../tutorial/configure-ssl.html"><span class="doc">Configure mongod and mongos for TLS/SSL</span></a> and
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html"><span class="doc">TLS/SSL Configuration for Clients</span></a> .</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-sslpemkeyfile">
<code class="descname">--sslPEMKeyFile</code><code class="descclassname">=&lt;filename&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-sslpemkeyfile" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the <code class="file docutils literal"><span class="pre">.pem</span></code> file that contains both the TLS/SSL certificate
and key. Specify the file name of the <code class="file docutils literal"><span class="pre">.pem</span></code> file using relative
or absolute paths.</p>
<p>This option is required when using the <a class="reference internal" href="#cmdoption-mongorestore-ssl"><code class="xref std std-option docutils literal"><span class="pre">--ssl</span></code></a> option to connect
to a <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> or <a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> that has
<a class="reference internal" href="../configuration-options.html#net.ssl.CAFile" title="net.ssl.CAFile"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">CAFile</span></code></a> enabled <em>without</em>
<a class="reference internal" href="../configuration-options.html#net.ssl.allowConnectionsWithoutCertificates" title="net.ssl.allowConnectionsWithoutCertificates"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">allowConnectionsWithoutCertificates</span></code></a>.</p>
<p>For more information about TLS/SSL and MongoDB, see
<a class="reference internal" href="../../tutorial/configure-ssl.html"><span class="doc">Configure mongod and mongos for TLS/SSL</span></a> and
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html"><span class="doc">TLS/SSL Configuration for Clients</span></a> .</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-sslpemkeypassword">
<code class="descname">--sslPEMKeyPassword</code><code class="descclassname">=&lt;value&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-sslpemkeypassword" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the password to de-crypt the certificate-key file (i.e.
<a class="reference internal" href="#cmdoption-mongorestore-sslpemkeyfile"><code class="xref std std-option docutils literal"><span class="pre">--sslPEMKeyFile</span></code></a>). Use the <a class="reference internal" href="#cmdoption-mongorestore-sslpemkeypassword"><code class="xref std std-option docutils literal"><span class="pre">--sslPEMKeyPassword</span></code></a> option only if the
certificate-key file is encrypted. In all cases, the <strong class="program">mongorestore</strong> will
redact the password from all logging and reporting output.</p>
<p>If the private key in the PEM file is encrypted and you do not specify
the <a class="reference internal" href="#cmdoption-mongorestore-sslpemkeypassword"><code class="xref std std-option docutils literal"><span class="pre">--sslPEMKeyPassword</span></code></a> option, the <strong class="program">mongorestore</strong> will prompt for a passphrase. See
<a class="reference internal" href="../../tutorial/configure-ssl.html#ssl-certificate-password"><span class="std std-ref">TLS/SSL Certificate Passphrase</span></a>.</p>
<p>For more information about TLS/SSL and MongoDB, see
<a class="reference internal" href="../../tutorial/configure-ssl.html"><span class="doc">Configure mongod and mongos for TLS/SSL</span></a> and
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html"><span class="doc">TLS/SSL Configuration for Clients</span></a> .</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-sslcrlfile">
<code class="descname">--sslCRLFile</code><code class="descclassname">=&lt;filename&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-sslcrlfile" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the <code class="file docutils literal"><span class="pre">.pem</span></code> file that contains the Certificate Revocation
List. Specify the file name of the <code class="file docutils literal"><span class="pre">.pem</span></code> file using relative or
absolute paths.</p>
<p>For more information about TLS/SSL and MongoDB, see
<a class="reference internal" href="../../tutorial/configure-ssl.html"><span class="doc">Configure mongod and mongos for TLS/SSL</span></a> and
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html"><span class="doc">TLS/SSL Configuration for Clients</span></a> .</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-sslallowinvalidcertificates">
<code class="descname">--sslAllowInvalidCertificates</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-sslallowinvalidcertificates" title="Permalink to this definition">¶</a></dt>
<dd><p>Bypasses the validation checks for server certificates and allows
the use of invalid certificates. When using the
<a class="reference internal" href="../configuration-options.html#net.ssl.allowInvalidCertificates" title="net.ssl.allowInvalidCertificates"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">allowInvalidCertificates</span></code></a> setting, MongoDB logs as a
warning the use of the invalid certificate.</p>
<p>Starting in MongoDB 4.0, if you specify
<code class="docutils literal"><span class="pre">--sslAllowInvalidCertificates</span></code> or
<code class="docutils literal"><span class="pre">net.ssl.allowInvalidCertificates:</span> <span class="pre">true</span></code> (or in MongoDB 4.2, the
alias <code class="docutils literal"><span class="pre">--tlsAllowInvalidateCertificates</span></code> or
<code class="docutils literal"><span class="pre">net.tls.allowInvalidCertificates:</span> <span class="pre">true</span></code>) when using x.509
authentication, an invalid certificate is only sufficient to
establish a TLS/SSL connection but is <em>insufficient</em> for
authentication.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>Although available, avoid using the
<code class="docutils literal"><span class="pre">--sslAllowInvalidCertificates</span></code> option if possible. If the use of
<code class="docutils literal"><span class="pre">--sslAllowInvalidCertificates</span></code> is necessary, only use the option
on systems where intrusion is not possible.</p>
<p class="last">If the <a class="reference internal" href="mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell (and other
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html#mongodb-tools-support-ssl"><span class="std std-ref">MongoDB Tools</span></a>) runs with the
<code class="docutils literal"><span class="pre">--sslAllowInvalidCertificates</span></code> option, the
<a class="reference internal" href="mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell (and other
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html#mongodb-tools-support-ssl"><span class="std std-ref">MongoDB Tools</span></a>) will not attempt to validate
the server certificates. This creates a vulnerability to expired
<a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and <a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> certificates as
well as to foreign processes posing as valid
<a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> or <a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instances. If you
only need to disable the validation of the hostname in the
TLS/SSL certificates, see <code class="docutils literal"><span class="pre">--sslAllowInvalidHostnames</span></code>.</p>
</div>
<p>For more information about TLS/SSL and MongoDB, see
<a class="reference internal" href="../../tutorial/configure-ssl.html"><span class="doc">Configure mongod and mongos for TLS/SSL</span></a> and
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html"><span class="doc">TLS/SSL Configuration for Clients</span></a> .</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-sslallowinvalidhostnames">
<code class="descname">--sslAllowInvalidHostnames</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-sslallowinvalidhostnames" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables the validation of the hostnames in TLS/SSL certificates. Allows
<strong class="program">mongorestore</strong> to connect to MongoDB instances even if the hostname in their
certificates do not match the specified hostname.</p>
<p>For more information about TLS/SSL and MongoDB, see
<a class="reference internal" href="../../tutorial/configure-ssl.html"><span class="doc">Configure mongod and mongos for TLS/SSL</span></a> and
<a class="reference internal" href="../../tutorial/configure-ssl-clients.html"><span class="doc">TLS/SSL Configuration for Clients</span></a> .</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-username">
<code class="descname">--username</code><code class="descclassname">=&lt;username&gt;</code><code class="descclassname">, </code><code class="descname">-u</code><code class="descclassname">=&lt;username&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-username" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies a username with which to authenticate to a MongoDB database
that uses authentication. Use in conjunction with the <a class="reference internal" href="#cmdoption-mongorestore-password"><code class="xref std std-option docutils literal"><span class="pre">--password</span></code></a> and
<a class="reference internal" href="#cmdoption-mongorestore-authenticationdatabase"><code class="xref std std-option docutils literal"><span class="pre">--authenticationDatabase</span></code></a> options.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You cannot specify both <a class="reference internal" href="#cmdoption-mongorestore-username"><code class="xref std std-option docutils literal"><span class="pre">--username</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-password">
<code class="descname">--password</code><code class="descclassname">=&lt;password&gt;</code><code class="descclassname">, </code><code class="descname">-p</code><code class="descclassname">=&lt;password&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-password" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies a password with which to authenticate to a MongoDB database
that uses authentication. Use in conjunction with the <a class="reference internal" href="#cmdoption-mongorestore-username"><code class="xref std std-option docutils literal"><span class="pre">--username</span></code></a> and
<a class="reference internal" href="#cmdoption-mongorestore-authenticationdatabase"><code class="xref std std-option docutils literal"><span class="pre">--authenticationDatabase</span></code></a> options.</p>
<p>To prompt the user for the password, pass the <a class="reference internal" href="#cmdoption-mongorestore-username"><code class="xref std std-option docutils literal"><span class="pre">--username</span></code></a>
option without <a class="reference internal" href="#cmdoption-mongorestore-password"><code class="xref std std-option docutils literal"><span class="pre">--password</span></code></a> or specify an empty string as the
<a class="reference internal" href="#cmdoption-mongorestore-password"><code class="xref std std-option docutils literal"><span class="pre">--password</span></code></a> value, as in <code class="docutils literal"><span class="pre">--password=&quot;&quot;</span></code> .</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You cannot specify both <a class="reference internal" href="#cmdoption-mongorestore-password"><code class="xref std std-option docutils literal"><span class="pre">--password</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-authenticationdatabase">
<code class="descname">--authenticationDatabase</code><code class="descclassname">=&lt;dbname&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-authenticationdatabase" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the authentication database where the specified <a class="reference internal" href="#cmdoption-mongorestore-username"><code class="xref std std-option docutils literal"><span class="pre">--username</span></code></a> has been created.
See <a class="reference internal" href="../../core/security-users.html#user-authentication-database"><span class="std std-ref">Authentication Database</span></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You cannot specify both <a class="reference internal" href="#cmdoption-mongorestore-authenticationdatabase"><code class="xref std std-option docutils literal"><span class="pre">--authenticationDatabase</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-authenticationmechanism">
<code class="descname">--authenticationMechanism</code><code class="descclassname">=&lt;name&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-authenticationmechanism" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Default</em>: SCRAM-SHA-1</p>
<p>Specifies the authentication mechanism the <strong class="program">mongorestore</strong> instance uses to
authenticate to the <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> or <a class="reference internal" href="mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a>.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 4.0: </span>MongoDB removes support for the deprecated MongoDB
Challenge-Response (<code class="docutils literal"><span class="pre">MONGODB-CR</span></code>) authentication mechanism.</p>
<p>MongoDB adds support for SCRAM mechanism using the SHA-256 hash
function (<code class="docutils literal"><span class="pre">SCRAM-SHA-256</span></code>).</p>
</div>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="33%" />
<col width="67%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Value</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../../core/security-scram.html#authentication-scram-sha-1"><span class="std std-ref">SCRAM-SHA-1</span></a></td>
<td><a class="reference external" href="https://tools.ietf.org/html/rfc5802">RFC 5802</a> standard
Salted Challenge Response Authentication Mechanism using the SHA-1
hash function.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../../core/security-scram.html#authentication-scram-sha-256"><span class="std std-ref">SCRAM-SHA-256</span></a></td>
<td><p class="first"><a class="reference external" href="https://tools.ietf.org/html/rfc7677">RFC 7677</a> standard
Salted Challenge Response Authentication Mechanism using the SHA-256
hash function.</p>
<p>Requires featureCompatibilityVersion set to <code class="docutils literal"><span class="pre">4.0</span></code>.</p>
<div class="last versionadded">
<p><span class="versionmodified">New in version 4.0.</span></p>
</div>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../../core/security-x.509.html#security-auth-x509"><span class="std std-ref">MONGODB-X509</span></a></td>
<td>MongoDB TLS/SSL certificate authentication.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../../core/authentication-mechanisms-enterprise.html#security-auth-kerberos"><span class="std std-ref">GSSAPI</span></a> (Kerberos)</td>
<td>External authentication using Kerberos. This mechanism is
available only in <a class="reference external" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?jmp=docs">MongoDB Enterprise</a>.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../../core/authentication-mechanisms-enterprise.html#security-auth-ldap"><span class="std std-ref">PLAIN</span></a> (LDAP SASL)</td>
<td>External authentication using LDAP. You can also use <code class="docutils literal"><span class="pre">PLAIN</span></code>
for authenticating in-database users. <code class="docutils literal"><span class="pre">PLAIN</span></code> transmits
passwords in plain text. This mechanism is available only in
<a class="reference external" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?jmp=docs">MongoDB Enterprise</a>.</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You cannot specify both <a class="reference internal" href="#cmdoption-mongorestore-authenticationmechanism"><code class="xref std std-option docutils literal"><span class="pre">--authenticationMechanism</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-gssapiservicename">
<code class="descname">--gssapiServiceName</code><code class="descclassname">=&lt;serviceName&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-gssapiservicename" title="Permalink to this definition">¶</a></dt>
<dd><p>Specify the name of the service using <a class="reference internal" href="../../core/kerberos.html"><span class="doc">GSSAPI/Kerberos</span></a>. Only required if the service does not use the
default name of <code class="docutils literal"><span class="pre">mongodb</span></code>.</p>
<p>This option is available only in MongoDB Enterprise.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-gssapihostname">
<code class="descname">--gssapiHostName</code><code class="descclassname">=&lt;hostname&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-gssapihostname" title="Permalink to this definition">¶</a></dt>
<dd><p>Specify the hostname of a service using <a class="reference internal" href="../../core/kerberos.html"><span class="doc">GSSAPI/Kerberos</span></a>. <em>Only</em> required if the hostname of a machine does
not match the hostname resolved by DNS.</p>
<p>This option is available only in MongoDB Enterprise.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-db">
<code class="descname">--db</code><code class="descclassname">=&lt;database&gt;</code><code class="descclassname">, </code><code class="descname">-d</code><code class="descclassname">=&lt;database&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-db" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the destination database for <strong class="program">mongorestore</strong> to restore data
<em>into</em> when restoring from a BSON file. If the database does not
exist, <strong class="program">mongorestore</strong> creates the database. For example, the following
restores the <code class="docutils literal"><span class="pre">salaries</span></code> collection into the <code class="docutils literal"><span class="pre">reporting</span></code> database.</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-sh"><div class="highlight"><pre><span></span>mongorestore --db<span class="o">=</span>reporting dump/test/salaries.bson
</pre></div>
</div>
</div>
<p>If you do not specify <a class="reference internal" href="#cmdoption-mongorestore-db"><code class="xref std std-option docutils literal"><span class="pre">--db</span></code></a>, <strong class="program">mongorestore</strong> takes the database name
from the data files.</p>
<p>The use of <a class="reference internal" href="#cmdoption-mongorestore-db"><code class="xref std std-option docutils literal"><span class="pre">--db</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-collection"><code class="xref std std-option docutils literal"><span class="pre">--collection</span></code></a> options are
deprecated when restoring from a directory or an archive file.
Instead, to restore from an archive or a directory, see
<a class="reference internal" href="#cmdoption-mongorestore-nsinclude"><code class="xref std std-option docutils literal"><span class="pre">--nsInclude</span></code></a> instead.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You cannot specify both <a class="reference internal" href="#cmdoption-mongorestore-db"><code class="xref std std-option docutils literal"><span class="pre">--db</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>.</p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-collection">
<code class="descname">--collection</code><code class="descclassname">=&lt;collection&gt;</code><code class="descclassname">, </code><code class="descname">-c</code><code class="descclassname">=&lt;collection&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-collection" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the name of the destination collection for <strong class="program">mongorestore</strong> to
restore data <em>into</em> when restoring from a BSON file. If
you do not specify <a class="reference internal" href="#cmdoption-mongorestore-collection"><code class="xref std std-option docutils literal"><span class="pre">--collection</span></code></a>, <strong class="program">mongorestore</strong> takes
the collection name from the input filename. If the input file has an
extension, MongoDB omits the extension of the file from the collection
name.</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-sh"><div class="highlight"><pre><span></span>mongorestore --db<span class="o">=</span>reporting --collection<span class="o">=</span>employeesalaries dump/test/salaries.bson
</pre></div>
</div>
</div>
<p>The use of <a class="reference internal" href="#cmdoption-mongorestore-db"><code class="xref std std-option docutils literal"><span class="pre">--db</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-collection"><code class="xref std std-option docutils literal"><span class="pre">--collection</span></code></a> options are
deprecated when restoring from a directory or an archive file.
Instead, to restore from an archive or a directory, see
<a class="reference internal" href="#cmdoption-mongorestore-nsinclude"><code class="xref std std-option docutils literal"><span class="pre">--nsInclude</span></code></a> instead.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-nsexclude">
<code class="descname">--nsExclude</code><code class="descclassname">=&lt;namespace pattern&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-nsexclude" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>Specifies a <a class="reference internal" href="../glossary.html#term-namespace"><span class="xref std std-term">namespace</span></a> pattern (e.g. <code class="docutils literal"><span class="pre">&quot;test.myCollection&quot;</span></code>,
<code class="docutils literal"><span class="pre">&quot;reporting.*&quot;</span></code>, <code class="docutils literal"><span class="pre">&quot;dept*.bar&quot;</span></code>) to <em>exclude</em> the matching
namespaces from the restore. In the pattern, you can use asterisks
<code class="docutils literal"><span class="pre">*</span></code> as <em>wild cards</em>. For an example of the wildcard pattern, see
<a class="reference internal" href="#example-basic-wildcard-usage"><span class="std std-ref">Restore Collections Using Wild Cards</span></a>.</p>
<p>You can specify <a class="reference internal" href="#cmdoption-mongorestore-nsexclude"><code class="xref std std-option docutils literal"><span class="pre">--nsExclude</span></code></a> multiple times to exclude multiple namespace
patterns.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-nsinclude">
<code class="descname">--nsInclude</code><code class="descclassname">=&lt;namespace pattern&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-nsinclude" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>Specifies a <a class="reference internal" href="../glossary.html#term-namespace"><span class="xref std std-term">namespace</span></a> pattern (e.g. <code class="docutils literal"><span class="pre">&quot;test.myCollection&quot;</span></code>,
<code class="docutils literal"><span class="pre">&quot;reporting.*&quot;</span></code>, <code class="docutils literal"><span class="pre">&quot;dept*.bar&quot;</span></code>) to restore only the namespaces
that match the pattern. In the pattern, you can use asterisks <code class="docutils literal"><span class="pre">*</span></code>
as <em>wild cards</em>. For an example of the wildcard pattern, see
<a class="reference internal" href="#example-basic-wildcard-usage"><span class="std std-ref">Restore Collections Using Wild Cards</span></a>.</p>
<p>You can specify <a class="reference internal" href="#cmdoption-mongorestore-nsinclude"><code class="xref std std-option docutils literal"><span class="pre">--nsInclude</span></code></a> multiple times to include multiple namespace
patterns.</p>
<p>If source directory or file (i.e. the directory/file from which you
are restoring the data) does not contain data files that match the
namespace pattern, no data will be restored.</p>
<p>For collection names that contain non-ascii characters,
<a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> outputs the corresponding filenames with
percent-encoded names. However, to restore these collections, do not
use the encoded names. Instead, use the namespace with the non-ascii
characters.</p>
<p>For example, if the dump directory contains
<code class="docutils literal"><span class="pre">dump/test/caf%C3%A9s.bson</span></code>, specify <code class="docutils literal"><span class="pre">--nsInclude</span> <span class="pre">&quot;test.cafés&quot;</span></code>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-nsfrom">
<code class="descname">--nsFrom</code><code class="descclassname">=&lt;namespace pattern&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-nsfrom" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>Use with <a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> to rename a <a class="reference internal" href="../glossary.html#term-namespace"><span class="xref std std-term">namespace</span></a> during the
restore operation. <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> specifies the collection in the
dump file, while <a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> specifies the name that should be
used in the restored database.</p>
<p><a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> accepts a <em>namespace pattern</em> as its argument. The namespace
pattern permits <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> to refer to any namespace that matches the
specified pattern. <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> matches the smallest valid occurence
of the namespace pattern.</p>
<p>For simple replacements, use asterisks (<code class="docutils literal"><span class="pre">*</span></code>) as wild cards.
Escape all literal asterisks and backslashes with a backslash.
Replacements correspond linearly to matches: each asterisk in
<code class="docutils literal"><span class="pre">--nsFrom</span></code> must correspond to an asterisk in <code class="docutils literal"><span class="pre">--nsTo</span></code>, and the
first asterisk in <code class="docutils literal"><span class="pre">--nsFrom</span></code> matches the first asterisk in <code class="docutils literal"><span class="pre">nsTo</span></code>.</p>
<p>For more complex replacements, use dollar signs to delimit a “wild
card” variable to use in the replacement.
<a class="reference internal" href="#example-complex-wildcard-usage"><span class="std std-ref">Change Collections’ Namespaces during Restore</span></a> provides an example of complex
replacements with dollar sign-delimited wild cards.</p>
<p>Unlike replacements with asterisks, replacements with dollar
sign-delimited wild cards do <strong>not</strong> need to be linear.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-nsto">
<code class="descname">--nsTo</code><code class="descclassname">=&lt;namespace pattern&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-nsto" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>Use with <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> to rename a <a class="reference internal" href="../glossary.html#term-namespace"><span class="xref std std-term">namespace</span></a> during the
restore operation. <a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> specifies the new collection
name to use in the restored database, while
<a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> specifies the name in the dump file.</p>
<p><a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> accepts a <em>namespace pattern</em> as its argument. The namespace
pattern permits <a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> to refer to any namespace that matches the
specified pattern. <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> matches the smallest valid occurence
of the namespace pattern.</p>
<p>For simple replacements, use asterisks (<code class="docutils literal"><span class="pre">*</span></code>) as wild cards.
Escape all literal asterisks and backslashes with a backslash.
Replacements correspond linearly to matches: each asterisk in
<code class="docutils literal"><span class="pre">--nsFrom</span></code> must correspond to an asterisk in <code class="docutils literal"><span class="pre">--nsTo</span></code>, and the
first asterisk in <code class="docutils literal"><span class="pre">--nsFrom</span></code> matches the first asterisk in <code class="docutils literal"><span class="pre">nsTo</span></code>.</p>
<p>For more complex replacements, use dollar signs to delimit a “wild
card” variable to use in the replacement.
<a class="reference internal" href="#example-complex-wildcard-usage"><span class="std std-ref">Change Collections’ Namespaces during Restore</span></a> provides an example of complex
replacements with dollar sign-delimited wild cards.</p>
<p>Unlike replacements with asterisks, replacements with dollar
sign-delimited wild cards do <strong>not</strong> need to be linear.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-objcheck">
<code class="descname">--objcheck</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-objcheck" title="Permalink to this definition">¶</a></dt>
<dd><p>Forces <strong class="program">mongorestore</strong> to validate all requests from clients
upon receipt to ensure that clients never insert invalid documents into
the database. For objects with a high degree of sub-document nesting,
<a class="reference internal" href="#cmdoption-mongorestore-objcheck"><code class="xref std std-option docutils literal"><span class="pre">--objcheck</span></code></a> can have a small impact on performance.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-drop">
<code class="descname">--drop</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Before restoring the collections from the dumped backup, drops the
collections from the target database. <a class="reference internal" href="#cmdoption-mongorestore-drop"><code class="xref std std-option docutils literal"><span class="pre">--drop</span></code></a> does not drop
collections that are not in the backup.</p>
<p>When the restore includes the <code class="docutils literal"><span class="pre">admin</span></code> database, <strong class="program">mongorestore</strong> with
<a class="reference internal" href="#cmdoption-mongorestore-drop"><code class="xref std std-option docutils literal"><span class="pre">--drop</span></code></a> removes all user credentials and replaces them with the
users defined in the dump file. Therefore, in systems with
<a class="reference internal" href="../configuration-options.html#security.authorization" title="security.authorization"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">authorization</span></code></a> enabled, <strong class="program">mongorestore</strong> must be able
to authenticate to an existing user <em>and</em> to a user defined in the
dump file. If <strong class="program">mongorestore</strong> can’t authenticate to a user defined in the
dump file, the restoration process will fail, leaving an empty
database.</p>
<p>If a collection is dropped and recreated as part of the restore, the
newly created collection has a different UUID unless <a class="reference internal" href="#cmdoption-mongorestore-drop"><code class="xref std std-option docutils literal"><span class="pre">--drop</span></code></a> is used with <a class="reference internal" href="#cmdoption-mongorestore-preserveuuid"><code class="xref std std-option docutils literal"><span class="pre">--preserveUUID</span></code></a>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-preserveuuid">
<code class="descname">--preserveUUID</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-preserveuuid" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 4.0.</span></p>
</div>
<p>Restored collections use the UUID from the restore data instead of
creating a new UUID for collections that are dropped and recreated
as part of the restore.</p>
<p>To use <a class="reference internal" href="#cmdoption-mongorestore-preserveuuid"><code class="xref std std-option docutils literal"><span class="pre">--preserveUUID</span></code></a>, you
must also include the <a class="reference internal" href="#cmdoption-mongorestore-drop"><code class="xref std std-option docutils literal"><span class="pre">--drop</span></code></a> option.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-dryrun">
<code class="descname">--dryRun</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-dryrun" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>Runs <strong class="program">mongorestore</strong> without actually importing any data, returning the
<strong class="program">mongorestore</strong> summary information. Use with <code class="docutils literal"><span class="pre">--verbose</span></code> to produce
more detailed summary information.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-oplogreplay">
<code class="descname">--oplogReplay</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-oplogreplay" title="Permalink to this definition">¶</a></dt>
<dd><p>After restoring the database dump, replays the <a class="reference internal" href="../glossary.html#term-oplog"><span class="xref std std-term">oplog</span></a> entries
from a bson file.
When used in conjunction with <a class="reference internal" href="mongodump.html#cmdoption-mongodump-oplog"><code class="xref std std-option docutils literal"><span class="pre">mongodump</span> <span class="pre">--oplog</span></code></a>,
<code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span> <span class="pre">--oplogReplay</span></code>
restores the database to the point-in-time backup captured with the
<code class="docutils literal"><span class="pre">mongodump</span> <span class="pre">--oplog</span></code> command.</p>
<p><strong class="program">mongorestore</strong> searches for any valid source  for the bson file
in the following locations:</p>
<ul class="simple">
<li>The top level of the dump directory, as in the case of a dump created
with <a class="reference internal" href="mongodump.html#cmdoption-mongodump-oplog"><code class="xref std std-option docutils literal"><span class="pre">mongodump</span> <span class="pre">--oplog</span></code></a>.</li>
<li>The path specified by <a class="reference internal" href="#cmdoption-mongorestore-oplogfile"><code class="xref std std-option docutils literal"><span class="pre">--oplogFile</span></code></a>.</li>
<li><code class="docutils literal"><span class="pre">&lt;dump-directory&gt;/local/oplog.rs.bson</span></code>, as in the case of a dump
of the <code class="docutils literal"><span class="pre">oplog.rs</span></code> collection in the <code class="docutils literal"><span class="pre">local</span></code> database
on a <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> that is a member of a replica set.</li>
</ul>
<p>If there is an <code class="docutils literal"><span class="pre">oplog.bson</span></code> file at the top level of the dump
directory <strong>and</strong> a path specified by <a class="reference internal" href="#cmdoption-mongorestore-oplogfile"><code class="xref std std-option docutils literal"><span class="pre">--oplogFile</span></code></a>,
<strong class="program">mongorestore</strong> returns an error.</p>
<p>If there is an <code class="docutils literal"><span class="pre">oplog.bson</span></code> file at the top level of the dump directory,
<strong class="program">mongorestore</strong> restores that file as the oplog. If there are also bson
files in the <code class="docutils literal"><span class="pre">dump/local</span></code> directory, <strong class="program">mongorestore</strong> restores them like
normal collections.</p>
<p>If you specify an oplog file using <a class="reference internal" href="#cmdoption-mongorestore-oplogfile"><code class="xref std std-option docutils literal"><span class="pre">--oplogFile</span></code></a>,
<strong class="program">mongorestore</strong> restores that file as the oplog. If there are also bson
files in the <code class="docutils literal"><span class="pre">dump/local</span></code> directory, <strong class="program">mongorestore</strong> restores them like
normal collections.</p>
<p>For an example of <a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a>, see <a class="reference internal" href="../../tutorial/backup-and-restore-tools.html#backup-restore-oplogreplay"><span class="std std-ref">Restore Point in Time Oplog Backup</span></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>When using <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> with <a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a> to restore
a replica set, you must
restore a full dump of a <a class="reference internal" href="../glossary.html#term-replica-set"><span class="xref std std-term">replica set</span></a> member created
using <code class="xref mongodb mongodb-binary docutils literal"><span class="pre">~bin.mongodump</span> <span class="pre">--oplog</span></code>.
<a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> with <a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a> fails if you use any of
the following options to limit the data be restored:</p>
<ul class="last simple">
<li><a class="reference internal" href="#cmdoption-mongorestore-db"><code class="xref std std-option docutils literal"><span class="pre">--db</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-collection"><code class="xref std std-option docutils literal"><span class="pre">--collection</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-nsinclude"><code class="xref std std-option docutils literal"><span class="pre">--nsInclude</span></code></a></li>
<li><a class="reference internal" href="#cmdoption-mongorestore-nsexclude"><code class="xref std std-option docutils literal"><span class="pre">--nsExclude</span></code></a></li>
</ul>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="#mongorestore-required-access"><span class="std std-ref">mongorestore Required Access</span></a></p>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="mongodump.html#cmdoption-mongodump-oplog"><code class="xref std std-option docutils literal"><span class="pre">mongodump</span> <span class="pre">--oplog</span></code></a></p>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-oploglimit">
<code class="descname">--oplogLimit</code><code class="descclassname">=&lt;timestamp&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-oploglimit" title="Permalink to this definition">¶</a></dt>
<dd><p>Prevents <strong class="program">mongorestore</strong> from applying <a class="reference internal" href="../glossary.html#term-oplog"><span class="xref std std-term">oplog</span></a> entries
with timestamp newer than or equal to <code class="docutils literal"><span class="pre">&lt;timestamp&gt;</span></code>. Specify
<code class="docutils literal"><span class="pre">&lt;timestamp&gt;</span></code> values in the form of <code class="docutils literal"><span class="pre">&lt;time_t&gt;:&lt;ordinal&gt;</span></code>, where
<code class="docutils literal"><span class="pre">&lt;time_t&gt;</span></code> is the seconds since the UNIX epoch, and <code class="docutils literal"><span class="pre">&lt;ordinal&gt;</span></code>
represents a counter of operations in the oplog that occurred in the
specified second.</p>
<p>You must use <a class="reference internal" href="#cmdoption-mongorestore-oploglimit"><code class="xref std std-option docutils literal"><span class="pre">--oplogLimit</span></code></a> in conjunction with the
<a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a> option.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-oplogfile">
<code class="descname">--oplogFile</code><code class="descclassname">=&lt;path&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-oplogfile" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>Specifies the path to the oplog file containing oplog data for the
restore. Use with <a class="reference internal" href="#cmdoption-mongorestore-oplogreplay"><code class="xref std std-option docutils literal"><span class="pre">--oplogReplay</span></code></a>.</p>
<p>If you specify <a class="reference internal" href="#cmdoption-mongorestore-oplogfile"><code class="xref std std-option docutils literal"><span class="pre">--oplogFile</span></code></a> and there is an <code class="file docutils literal"><span class="pre">oplog.bson</span></code>
file at the top level of the dump directory, <strong class="program">mongorestore</strong> returns an
error.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-convertlegacyindexes">
<code class="descname">--convertLegacyIndexes</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-convertlegacyindexes" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 4.2.</span></p>
</div>
<p>Removes any invalid index options specified in the corresponding
<a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> output, and rewrites any legacy index key
values to use valid values.</p>
<ul class="simple">
<li><em>Invalid index options</em> are any options specified to an index that
are not listed as a <a class="reference internal" href="../command/createIndexes.html#createindexes-options"><span class="std std-ref">valid field</span></a> for
the <a class="reference internal" href="../command/createIndexes.html#dbcmd.createIndexes" title="createIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">createIndexes</span></code></a> command. For example, <code class="docutils literal"><span class="pre">name</span></code> and
<code class="docutils literal"><span class="pre">collation</span></code> are valid, but an arbitrary <code class="docutils literal"><span class="pre">custom_field</span></code> is not.
With <code class="docutils literal"><span class="pre">--convertLegacyIndexes</span></code> specified, any invalid index
options found are dropped.</li>
<li><em>Legacy index key values</em> are any values for
<a class="reference internal" href="../../indexes.html#index-types"><span class="std std-ref">index type</span></a> that are
<a class="reference internal" href="../../release-notes/3.4-compatibility.html#index-validation"><span class="std std-ref">no longer supported</span></a>. For example,
<code class="docutils literal"><span class="pre">1</span></code> and <code class="docutils literal"><span class="pre">-1</span></code> are valid index key values, but <code class="docutils literal"><span class="pre">0</span></code> or an empty
string are legacy values. With <code class="docutils literal"><span class="pre">--convertLegacyIndexes</span></code>
specified, any legacy index key values found are rewritten as
<code class="docutils literal"><span class="pre">1</span></code>. Non-empty string values are not replaced.</li>
</ul>
<p>Without the <code class="docutils literal"><span class="pre">--convertLegacyIndexes</span></code> option specified, the presence
of invalid index options or legacy index key values could cause the
index build to fail.</p>
<p>If the <a class="reference internal" href="#cmdoption-mongorestore-noindexrestore"><code class="xref std std-option docutils literal"><span class="pre">--noIndexRestore</span></code></a>
option is specified to <strong class="program">mongorestore</strong>, the
<code class="docutils literal"><span class="pre">--convertLegacyIndexes</span></code> option is ignored.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-keepindexversion">
<code class="descname">--keepIndexVersion</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-keepindexversion" title="Permalink to this definition">¶</a></dt>
<dd><p>Prevents <strong class="program">mongorestore</strong> from upgrading the index to the latest
version during the restoration process.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-noindexrestore">
<code class="descname">--noIndexRestore</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-noindexrestore" title="Permalink to this definition">¶</a></dt>
<dd><p>Prevents <strong class="program">mongorestore</strong> from restoring and building indexes as
specified in the corresponding <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> output.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-nooptionsrestore">
<code class="descname">--noOptionsRestore</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-nooptionsrestore" title="Permalink to this definition">¶</a></dt>
<dd><p>Prevents <strong class="program">mongorestore</strong> from setting the collection options,
such as those specified by the <a class="reference internal" href="../command/collMod.html#dbcmd.collMod" title="collMod"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">collMod</span></code></a> <a class="reference internal" href="../glossary.html#term-database-command"><span class="xref std std-term">database
command</span></a>, on restored collections.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-restoredbusersandroles">
<code class="descname">--restoreDbUsersAndRoles</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-restoredbusersandroles" title="Permalink to this definition">¶</a></dt>
<dd><p>Restore user and role definitions for the given database. See
<a class="reference internal" href="../system-roles-collection.html"><span class="doc">system.roles Collection</span></a> and
<a class="reference internal" href="../system-users-collection.html"><span class="doc">system.users Collection</span></a> for more information.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-writeconcern">
<code class="descname">--writeConcern</code><code class="descclassname">=&lt;document&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-writeconcern" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Default</em>: majority</p>
<p>Specifies the <a class="reference internal" href="../glossary.html#term-write-concern"><span class="xref std std-term">write concern</span></a> for each write operation that <strong class="program">mongorestore</strong>
performs.</p>
<p>Specify the write concern as a document with <a class="reference internal" href="../write-concern.html#wc-w"><span class="std std-ref">w options</span></a>:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>--writeConcern<span class="o">=</span><span class="s2">&quot;{w:&#39;majority&#39;}&quot;</span>
</pre></div>
</div>
</div>
<p>If the write concern is also included in the <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span>
<span class="pre">connection</span> <span class="pre">string</span></code></a>, the command-line
<a class="reference internal" href="#cmdoption-mongorestore-writeconcern"><code class="xref std std-option docutils literal"><span class="pre">--writeConcern</span></code></a> overrides the write concern specified in
the URI string.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-maintaininsertionorder">
<code class="descname">--maintainInsertionOrder</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-maintaininsertionorder" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Default</em>: false</p>
<p>If specified,</p>
<ul class="simple">
<li>Starting in version 4.2, <strong class="program">mongorestore</strong> inserts the documents in the
order of their appearance in the input source. That is, both the
bulk write batch order and document order within the batches are
maintained.</li>
<li>In earlier versions, only the batch order is maintained; document
order within batches are not maintained.</li>
</ul>
<p>Starting in MongoDB 4.2,
specifying <a class="reference internal" href="#cmdoption-mongorestore-maintaininsertionorder"><code class="xref std std-option docutils literal"><span class="pre">--maintainInsertionOrder</span></code></a> also enables <a class="reference internal" href="#cmdoption-mongorestore-stoponerror"><code class="xref std std-option docutils literal"><span class="pre">--stopOnError</span></code></a> and sets
<a class="reference internal" href="#cmdoption-mongorestore-numinsertionworkerspercollection"><code class="xref std std-option docutils literal"><span class="pre">numInsertionWorkersPerCollection</span></code></a> to 1.</p>
<p>If unspecified, <strong class="program">mongorestore</strong> may perform the insertions in an
arbitrary order.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-numparallelcollections">
<code class="descname">--numParallelCollections</code><code class="descclassname">=&lt;int&gt;</code><code class="descclassname">, </code><code class="descname">-j</code><code class="descclassname">=&lt;int&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-numparallelcollections" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Default</em>: 4</p>
<p>Number of collections <strong class="program">mongorestore</strong> should restore
in parallel.</p>
<p>If you specify <code class="docutils literal"><span class="pre">-j</span></code> when restoring a <em>single</em> collection, <code class="docutils literal"><span class="pre">-j</span></code>
maps to the <a class="reference internal" href="#cmdoption-mongorestore-numinsertionworkerspercollection"><code class="xref std std-option docutils literal"><span class="pre">--numInsertionWorkersPerCollection</span></code></a> option rather than
<a class="reference internal" href="#cmdoption-mongorestore-numparallelcollections"><code class="xref std std-option docutils literal"><span class="pre">--numParallelCollections</span></code></a>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-numinsertionworkerspercollection">
<code class="descname">--numInsertionWorkersPerCollection</code><code class="descclassname">=&lt;int&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-numinsertionworkerspercollection" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Default</em>: 1</p>
<p>Specifies the number of insertion workers to run concurrently per collection.</p>
<p>For large imports, increasing the number of insertion workers
may increase the speed of the import.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-stoponerror">
<code class="descname">--stopOnError</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-stoponerror" title="Permalink to this definition">¶</a></dt>
<dd><p>Forces <strong class="program">mongorestore</strong> to halt the restore when it encounters an
error.</p>
<p>Starting in version 4.2, <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>, by default,
continues when it encounters duplicate key and document
validation errors.  To ensure that the program stops on these errors, specify <a class="reference internal" href="#cmdoption-mongorestore-stoponerror"><code class="xref std std-option docutils literal"><span class="pre">--stopOnError</span></code></a>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-bypassdocumentvalidation">
<code class="descname">--bypassDocumentValidation</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-bypassdocumentvalidation" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables <strong class="program">mongorestore</strong> to bypass <a class="reference internal" href="../../core/schema-validation.html"><span class="doc">document validation</span></a>
during the operation. This lets you insert documents that do not
meet the validation requirements.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.2.1.</span></p>
</div>
</dd></dl>

<span class="target" id="mongorestore-path-option"></span><dl class="option">
<dt id="cmdoption-mongorestore-gzip">
<code class="descname">--gzip</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-gzip" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.2.</span></p>
</div>
<p>Restores from compressed files or data stream created by
<code class="xref mongodb mongodb-binary docutils literal"><span class="pre">~bin.mongodump</span> <span class="pre">--gzip</span></code></p>
<p>To restore from a dump directory that contains compressed files, run
<a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> with the <a class="reference internal" href="#cmdoption-mongorestore-gzip"><code class="xref std std-option docutils literal"><span class="pre">--gzip</span></code></a> option.</p>
<p>To restore from a compressed archive file, run <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> with
both the <a class="reference internal" href="#cmdoption-mongorestore-gzip"><code class="xref std std-option docutils literal"><span class="pre">--gzip</span></code></a>  and the <cite>–archive</cite> options.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-archive">
<code class="descname">--archive</code><code class="descclassname">=&lt;file&gt;</code><a class="headerlink" href="#cmdoption-mongorestore-archive" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 3.2.</span></p>
</div>
<p>Restores from the specified archive file or, if the file is
unspecified, from the standard input (<code class="docutils literal"><span class="pre">stdin</span></code>):</p>
<ul class="simple">
<li>To restore from an archive file, run <strong class="program">mongorestore</strong> with
the <code class="docutils literal"><span class="pre">--archive</span></code> option and the archive filename</li>
<li>To restore from the standard input, run <strong class="program">mongorestore</strong>
with the <code class="docutils literal"><span class="pre">--archive</span></code> option but <em>omit</em> the filename.</li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<ul class="last simple">
<li>You cannot use the <code class="docutils literal"><span class="pre">--archive</span></code> option with the <a class="reference internal" href="#cmdoption-mongorestore-dir"><code class="xref std std-option docutils literal"><span class="pre">--dir</span></code></a>
option.</li>
<li>If you use the <a class="reference internal" href="#cmdoption-mongorestore-archive"><code class="xref std std-option docutils literal"><span class="pre">--archive</span></code></a> option with the <a class="reference internal" href="#cmdoption-mongorestore-arg-path"><code class="xref std std-option docutils literal"><span class="pre">&lt;path&gt;</span></code></a>
parameter, <strong class="program">mongorestore</strong> ignores <a class="reference internal" href="#cmdoption-mongorestore-arg-path"><code class="xref std std-option docutils literal"><span class="pre">&lt;path&gt;</span></code></a> parameter.</li>
<li><strong class="program">mongorestore</strong> still supports the positional <code class="docutils literal"><span class="pre">-</span></code> parameter to
restore a <em>single</em> collection from the standard input.</li>
</ul>
</div>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-arg-path">
<code class="descname">&lt;path&gt;</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-mongorestore-arg-path" title="Permalink to this definition">¶</a></dt>
<dd><p>The directory path or BSON file name from which to restore data.</p>
<p>You cannot specify both the <code class="docutils literal"><span class="pre">&lt;path&gt;</span></code> argument and the <code class="docutils literal"><span class="pre">--dir</span></code>
option, which also specifies the dump directory, to <strong class="program">mongorestore</strong>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-mongorestore-dir">
<code class="descname">--dir</code><code class="descclassname">=string</code><a class="headerlink" href="#cmdoption-mongorestore-dir" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the dump directory.</p>
<ul class="simple">
<li>You cannot specify both the <code class="docutils literal"><span class="pre">--dir</span></code> option and the <code class="docutils literal"><span class="pre">&lt;path&gt;</span></code>
argument, which also specifies the dump directory, to <strong class="program">mongorestore</strong>.</li>
<li>You cannot use the <code class="docutils literal"><span class="pre">--archive</span></code> option with the <code class="docutils literal"><span class="pre">--dir</span></code> option.</li>
</ul>
</dd></dl>

</div>
<div class="section" id="examples">
<span id="mongorestore-examples"></span><h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="section" id="restore-with-access-control">
<h3>Restore with Access Control<a class="headerlink" href="#restore-with-access-control" title="Permalink to this headline">¶</a></h3>
<p>In the following example, <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> restores from
<code class="docutils literal"><span class="pre">/opt/backup/mongodump-2011-10-24</span></code> to a <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>
instance running on port <code class="docutils literal"><span class="pre">27017</span></code> on the host
<code class="docutils literal"><span class="pre">mongodb1.example.net</span></code>. The <a class="reference internal" href="#cmdoption-mongorestore-uri"><code class="xref std std-option docutils literal"><span class="pre">--uri</span></code></a>
string omits the user’s password to have <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>
prompt for the password.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --uri<span class="o">=</span><span class="s2">&quot;mongodb://user@mongodb1.example.net:27017/?authSource=admin&quot;</span> /opt/backup/mongodump-2011-10-24
</pre></div>
</div>
</div>
<p>Alternatively, you can specify the host, port, username, and
authentication database using <a class="reference internal" href="#cmdoption-mongorestore-host"><code class="xref std std-option docutils literal"><span class="pre">--host</span></code></a>,
<a class="reference internal" href="#cmdoption-mongorestore-port"><code class="xref std std-option docutils literal"><span class="pre">--port</span></code></a>, <a class="reference internal" href="#cmdoption-mongorestore-username"><code class="xref std std-option docutils literal"><span class="pre">--username</span></code></a>, and <a class="reference internal" href="#cmdoption-mongorestore-authenticationdatabase"><code class="xref std std-option docutils literal"><span class="pre">--authenticationDatabase</span></code></a>.  Omit <a class="reference internal" href="#cmdoption-mongorestore-password"><code class="xref std std-option docutils literal"><span class="pre">--password</span></code></a> to have <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> prompt for the password:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --host<span class="o">=</span>mongodb1.example.net --port<span class="o">=</span><span class="m">27017</span> --username<span class="o">=</span>user --authenticationDatabase<span class="o">=</span>admin /opt/backup/mongodump-2011-10-24
</pre></div>
</div>
</div>
</div>
<div class="section" id="restore-a-collection">
<h3>Restore a Collection<a class="headerlink" href="#restore-a-collection" title="Permalink to this headline">¶</a></h3>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>To restore a specific collection, use <a class="reference internal" href="#cmdoption-mongorestore-nsinclude"><code class="xref std std-option docutils literal"><span class="pre">--nsInclude</span></code></a>, passing in the full namespace
(<code class="docutils literal"><span class="pre">&lt;database&gt;.&lt;collection&gt;</span></code>) of the collection.</p>
<p>For example, the following restores the collection named
<code class="docutils literal"><span class="pre">purchaseorders</span></code> in the database <code class="docutils literal"><span class="pre">test</span></code> from the corresponding
files located in the <code class="docutils literal"><span class="pre">dump/</span></code> directory.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --nsInclude<span class="o">=</span>test.purchaseorders dump/
</pre></div>
</div>
</div>
<p>The <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> outputs the results, including the
number of documents restored:</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="m">2019</span>-06-28T19:23:42.858-0400   preparing collections to restore from
<span class="m">2019</span>-06-28T19:23:42.858-0400   reading metadata <span class="k">for</span> test.purchaseorders from dump/test/purchaseorders.metadata.json
<span class="m">2019</span>-06-28T19:23:42.893-0400   restoring test.purchaseorders from dump/test/purchaseorders.bson
<span class="m">2019</span>-06-28T19:23:42.896-0400   restoring indexes <span class="k">for</span> collection test.purchaseorders from metadata
<span class="m">2019</span>-06-28T19:23:42.991-0400   finished restoring test.purchaseorders <span class="o">(</span><span class="m">6</span> documents, <span class="m">0</span> failures<span class="o">)</span>
<span class="m">2019</span>-06-28T19:23:42.991-0400   <span class="m">6</span> document<span class="o">(</span>s<span class="o">)</span> restored successfully. <span class="m">0</span> document<span class="o">(</span>s<span class="o">)</span> failed to restore.
</pre></div>
</div>
</div>
<p>If the <code class="docutils literal"><span class="pre">dump/</span></code> directory does not contain the corresponding data
files for the specified namespace, no data will be restored:</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="m">2019</span>-07-08T14:39:57.121-0400. preparing collections to restore from
<span class="m">2019</span>-07-08T14:39:57.121-0400  <span class="m">0</span> document<span class="o">(</span>s<span class="o">)</span> restored successfully. <span class="m">0</span> document<span class="o">(</span>s<span class="o">)</span> failed to restore.
</pre></div>
</div>
</div>
<p>Alternatively, you can restore a specific collection using the
<a class="reference internal" href="#cmdoption-mongorestore-db"><code class="xref std std-option docutils literal"><span class="pre">--db</span></code></a>, <a class="reference internal" href="#cmdoption-mongorestore-collection"><code class="xref std std-option docutils literal"><span class="pre">--collection</span></code></a>, and a <code class="docutils literal"><span class="pre">.bson</span></code> file:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --db<span class="o">=</span><span class="nb">test</span> --collection<span class="o">=</span>purchaseorders dump/test/purchaseorders.bson
</pre></div>
</div>
</div>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="m">2019</span>-06-30T12:21:44.777-0400   checking <span class="k">for</span> collection data in dump/test/purchaseorders.bson
<span class="m">2019</span>-06-30T12:21:44.779-0400   reading metadata <span class="k">for</span> test.purchaseorders from dump/test/purchaseorders.metadata.json
<span class="m">2019</span>-06-30T12:21:44.813-0400   restoring test.purchaseorders from dump/test/purchaseorders.bson
<span class="m">2019</span>-06-30T12:21:44.881-0400   restoring indexes <span class="k">for</span> collection test.purchaseorders from metadata
<span class="m">2019</span>-06-30T12:21:44.987-0400   finished restoring test.purchaseorders <span class="o">(</span><span class="m">6</span> documents, <span class="m">0</span> failures<span class="o">)</span>
<span class="m">2019</span>-06-30T12:21:44.987-0400   <span class="m">6</span> document<span class="o">(</span>s<span class="o">)</span> restored successfully. <span class="m">0</span> document<span class="o">(</span>s<span class="o">)</span> failed to restore.
</pre></div>
</div>
</div>
</div>
<div class="section" id="restore-collections-using-wild-cards">
<span id="example-basic-wildcard-usage"></span><h3>Restore Collections Using Wild Cards<a class="headerlink" href="#restore-collections-using-wild-cards" title="Permalink to this headline">¶</a></h3>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p><a class="reference internal" href="#cmdoption-mongorestore-nsinclude"><code class="xref std std-option docutils literal"><span class="pre">--nsInclude</span></code></a> and
<a class="reference internal" href="#cmdoption-mongorestore-nsexclude"><code class="xref std std-option docutils literal"><span class="pre">--nsExclude</span></code></a> support specifying the
<a class="reference internal" href="../glossary.html#term-namespace"><span class="xref std std-term">namespaces</span></a> you wish to include or exclude from a
restore operation using asterisks as <em>wild cards</em>.</p>
<p>The following example restores the documents in the <code class="docutils literal"><span class="pre">dump/</span></code>
sub-directory of the current directory that match the specified
namespace pattern. The <a class="reference internal" href="#cmdoption-mongorestore-nsinclude"><code class="xref std std-option docutils literal"><span class="pre">--nsInclude</span></code></a>
statement specifies to only restore documents in the <code class="docutils literal"><span class="pre">transactions</span></code>
database while <a class="reference internal" href="#cmdoption-mongorestore-nsexclude"><code class="xref std std-option docutils literal"><span class="pre">--nsExclude</span></code></a>
instructs <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> to exclude collections whose
names end with <code class="docutils literal"><span class="pre">_dev</span></code>. <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> restores data to
the <a class="reference internal" href="mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> instance running on the localhost interface
on port <code class="docutils literal"><span class="pre">27017</span></code>.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --nsInclude<span class="o">=</span><span class="s1">&#39;transactions.*&#39;</span> --nsExclude<span class="o">=</span><span class="s1">&#39;transactions.*_dev&#39;</span> dump/
</pre></div>
</div>
</div>
</div>
<div class="section" id="change-collections-namespaces-during-restore">
<span id="example-complex-wildcard-usage"></span><h3>Change Collections’ Namespaces during Restore<a class="headerlink" href="#change-collections-namespaces-during-restore" title="Permalink to this headline">¶</a></h3>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
<p>MongoDB 3.4 added the <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> and
<a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> options, which enable you to
change the namespace of a collection that you are restoring.
<a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> support using asterisks as wild cards <em>and</em>
support using dollar signs to delimit “wild card” variables to use in
the replacement.</p>
<p>Consider a database <code class="docutils literal"><span class="pre">data</span></code> that you have exported to a <code class="docutils literal"><span class="pre">dump/</span></code>
directory using <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a>. The <code class="docutils literal"><span class="pre">data</span></code> database
contains the following collections:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">sales_customer1</span></code></li>
<li><code class="docutils literal"><span class="pre">sales_customer2</span></code></li>
<li><code class="docutils literal"><span class="pre">sales_customer3</span></code></li>
<li><code class="docutils literal"><span class="pre">users_customer1</span></code></li>
<li><code class="docutils literal"><span class="pre">users_customer2</span></code></li>
<li><code class="docutils literal"><span class="pre">users_customer3</span></code></li>
</ul>
<p>Using <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-nsto"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a>, you can restore the data into different
namespaces. The following operation</p>
<ul class="simple">
<li>restores the <code class="docutils literal"><span class="pre">sales_&lt;customerName&gt;</span></code> collections in the <code class="docutils literal"><span class="pre">data</span></code>
database to <code class="docutils literal"><span class="pre">sales</span></code> collections in the <code class="docutils literal"><span class="pre">&lt;customerName&gt;</span></code> database,
and</li>
<li>restores the <code class="docutils literal"><span class="pre">users_&lt;customerName&gt;</span></code> collections to <code class="docutils literal"><span class="pre">users</span></code>
collections in the <code class="docutils literal"><span class="pre">&lt;customerName&gt;</span></code> database.</li>
</ul>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --nsInclude<span class="o">=</span><span class="s1">&#39;data.*&#39;</span> --nsFrom<span class="o">=</span><span class="s1">&#39;data.$prefix$_$customer$&#39;</span> --nsTo<span class="o">=</span><span class="s1">&#39;$customer$.$prefix$&#39;</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="copy-clone-a-database">
<span id="mongorestore-example-copy-clone-database"></span><h3>Copy/Clone a Database<a class="headerlink" href="#copy-clone-a-database" title="Permalink to this headline">¶</a></h3>
<p>Starting in version 4.2, MongoDB removes the deprecated <code class="docutils literal"><span class="pre">copydb</span></code>
command and <code class="docutils literal"><span class="pre">clone</span></code> command.</p>
<p>As an alternative, users can use <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> and
<a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> (with the <code class="docutils literal"><span class="pre">mongorestore</span></code> options
<a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a>).</p>
<p>For example, to copy the <code class="docutils literal"><span class="pre">test</span></code> database from a local instance
running on the default port 27017 to the <code class="docutils literal"><span class="pre">examples</span></code> database on the
same instance, you can:</p>
<div class="docutils container">
<ol class="arabic">
<li><p class="first">Use <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> to  dump the <code class="docutils literal"><span class="pre">test</span></code> database to
an archive <code class="docutils literal"><span class="pre">mongodump-test-db</span></code>:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongodump --archive<span class="o">=</span><span class="s2">&quot;mongodump-test-db&quot;</span> --db<span class="o">=</span><span class="nb">test</span>
</pre></div>
</div>
</div>
</li>
<li><p class="first">Use <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> with <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsFrom</span></code></a> and <a class="reference internal" href="#cmdoption-mongorestore-nsfrom"><code class="xref std std-option docutils literal"><span class="pre">--nsTo</span></code></a> to restore (with database name change) from the
archive:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --archive<span class="o">=</span><span class="s2">&quot;mongodump-test-db&quot;</span> --nsFrom<span class="o">=</span><span class="s1">&#39;test.*&#39;</span> --nsTo<span class="o">=</span><span class="s1">&#39;examples.*&#39;</span>
</pre></div>
</div>
</div>
</li>
</ol>
<div class="admonition-tip admonition">
<p class="first admonition-title">Tip</p>
<p class="last">Include additional options as necessary, such as to specify
the uri or host, username, password and authentication
database.</p>
</div>
<p>Alternatively, instead of using an archive file, you can
<a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> the <code class="docutils literal"><span class="pre">test</span></code> database to the standard
output stream and pipe into <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongodump --archive --db<span class="o">=</span><span class="nb">test</span> <span class="p">|</span> mongorestore --archive  --nsFrom<span class="o">=</span><span class="s1">&#39;test.*&#39;</span> --nsTo<span class="o">=</span><span class="s1">&#39;examples.*&#39;</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="restore-from-an-archive-file">
<span id="mongorestore-example-archive-file"></span><h3>Restore from an Archive File<a class="headerlink" href="#restore-from-an-archive-file" title="Permalink to this headline">¶</a></h3>
<p>To restore from an archive file, run <code class="xref mongodb mongodb-binary docutils literal"><span class="pre">restore</span></code> with the new
<code class="docutils literal"><span class="pre">--archive</span></code> option and the archive filename.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --archive<span class="o">=</span>test.20150715.archive
</pre></div>
</div>
</div>
<div class="section" id="restore-a-database-from-an-archive-file">
<span id="mongorestore-example-archive-file-db"></span><h4>Restore a Database from an Archive File<a class="headerlink" href="#restore-a-database-from-an-archive-file" title="Permalink to this headline">¶</a></h4>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.2.</span></p>
</div>
<p>To restore from an archive file, run <code class="xref mongodb mongodb-binary docutils literal"><span class="pre">restore</span></code> with the new
<code class="docutils literal"><span class="pre">--archive</span></code> option and the archive filename. For example, the
following operation restores the <code class="docutils literal"><span class="pre">test</span></code> database from the file
<code class="docutils literal"><span class="pre">test.20150715.archive</span></code>.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --archive<span class="o">=</span>test.20150715.archive  --nsInclude<span class="o">=</span><span class="s2">&quot;test.*&quot;</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="restore-from-compressed-data">
<span id="mongorestore-example-gzip"></span><h3>Restore from Compressed Data<a class="headerlink" href="#restore-from-compressed-data" title="Permalink to this headline">¶</a></h3>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.2: </span>With the <code class="docutils literal"><span class="pre">--gzip</span></code> option, <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> can restore from
compressed files or data stream created by <a class="reference internal" href="mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a>.</p>
</div>
<p>To restore from a dump directory that contains compressed files, run
<a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> with the <a class="reference internal" href="#cmdoption-mongorestore-gzip"><code class="xref std std-option docutils literal"><span class="pre">--gzip</span></code></a>. For example, the following operation restores the <code class="docutils literal"><span class="pre">test</span></code>
database from the compressed files located in the default <code class="docutils literal"><span class="pre">dump</span></code>
directory:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --gzip  --nsInclude<span class="o">=</span><span class="s2">&quot;test.*&quot;</span> dump/
</pre></div>
</div>
</div>
<p>To restore from a compressed archive file, run
<a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> with the <a class="reference internal" href="#cmdoption-mongorestore-gzip"><code class="xref std std-option docutils literal"><span class="pre">--gzip</span></code></a> option and the <a class="reference internal" href="#cmdoption-mongorestore-archive"><code class="xref std std-option docutils literal"><span class="pre">--archive</span></code></a>
option. For example, the following operation restores the <code class="docutils literal"><span class="pre">test</span></code>
database from the archive file <code class="docutils literal"><span class="pre">test.20150715.gz</span></code>.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongorestore --gzip --archive<span class="o">=</span>test.20150715.gz --nsInclude<span class="o">=</span><span class="s2">&quot;test.*&quot;</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="restore-a-database-from-standard-input">
<span id="mongorestore-example-archive-stdin"></span><h3>Restore a Database from Standard Input<a class="headerlink" href="#restore-a-database-from-standard-input" title="Permalink to this headline">¶</a></h3>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.2.</span></p>
</div>
<p>To restore from the standard input, run <a class="reference internal" href="#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>
with the <a class="reference internal" href="#cmdoption-mongorestore-archive"><code class="xref std std-option docutils literal"><span class="pre">--archive</span></code></a> option but <em>omit</em>
the filename. For example:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-sh"><div class="highlight"><pre><span></span>mongodump --archive --db<span class="o">=</span><span class="nb">test</span> --port<span class="o">=</span><span class="m">27017</span> <span class="p">|</span> mongorestore --archive --port<span class="o">=</span><span class="m">27018</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>

                
    <div id="btnv">
      <span class="btn-arrow-left">&larr; &nbsp;</span>
      <a class="btn-prev-text" href="mongodump.html" title="Previous Section: mongodump"><span>mongodump</span></a>
      <a class="btn-next-text" href="bsondump.html" title="Next Section: bsondump"><span>bsondump</span></a>
      <span class="btn-arrow-right">&nbsp;&rarr;</span>
    </div>
                  <div class="footer">
                    <div class="copyright">
                      <p>&copy; MongoDB, Inc 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.</p>
                    </div>
                  </div>
              </div></div>
            </div>
        </div>
    </div>
    <div class="right-column">
      <div class="wrapper"> <div id='mongodb-docs-1'>
   <script type='text/javascript'>
      googletag.cmd.push(function() { googletag.display('mongodb-docs-1'); });
   </script>
</div>
            <div class="social">
               <a class="slack-icon" href="https://slackpass.io/mongo-db?jmp=docs" title="https://slackpass.io/mongo-db?jmp=docs"><i class="fab fa-slack" aria-hidden="true"></i></a>
               <a class="twitter-icon" href="https://twitter.com/MongoDB" title="https://twitter.com/MongoDB"><i class="fab fa-twitter-square"></i></a>
               <a class="youtube-icon" href="https://www.youtube.com/user/MongoDB" title="https://www.youtube.com/user/MongoDB"><i class="fab fa-youtube-square"></i></a>
               <a class="facebook-icon" href="https://www.facebook.com/mongodb" title="https://www.facebook.com/mongodb"><i class="fab fa-facebook-square"></i></a>
               <a class="stack-overflow-icon" href="https://stackoverflow.com/tags/mongodb/info" title="https://stackoverflow.com/tags/mongodb/info"><i class="fab fa-stack-overflow" aria-hidden="true"></i></a>
            </div>
        

      </div>
    </div>
    
      <div id="rating-panel"></div>
    
    <div class="clearfix"></div>
  </div>
  

  <script type="text/javascript">
  // Bootstrap array of links that should trigger a full page reload
  window.docsExcludedNav = ['/administration', '/administration/production-checklist', '/administration/indexes-management', '/aggregation', '/applications/geospatial-indexes', '/applications/indexes', '/contributors/getting-started', '/core/2d', '/core/2dsphere', '/core/auditing', '/core/authentication', '/core/authorization', '/core/backups', '/core/read-isolation-consistency-recency', '/core/databases-and-collections', '/core/geohaystack', '/core/index-single', '/core/index-compound', '/core/index-creation', '/core/index-hashed', '/core/index-multikey', '/core/index-partial', '/core/index-sparse', '/core/index-text', '/core/index-ttl', '/core/index-unique', '/core/index-wildcard', '/core/journaling', '/core/kerberos', '/core/map-reduce', '/core/operational-segregation', '/core/query-optimization', '/core/read-preference', '/core/replica-set-architectures', '/core/replica-set-high-availability', '/core/replica-set-members', '/core/replica-set-secondary', '/core/transactions', '/geospatial-queries', '/replication', '/core/sharded-cluster-components', '/core/wiredtiger', '/core/write-operations-atomicity', '/crud', '/indexes', '/installation', '/introduction', '/mongo', '/products/bi-connector', '/reference/command', '/reference/collation', '/text-search', '/tutorial/manage-the-database-profiler', '/core/index-text', '/reference/bson-types', '/reference/configuration-options', '/reference/indexes', '/reference/method', '/reference/operator/aggregation', '/reference/operator/query', '/reference/operator/query-modifier', '/reference/operator/update', '/reference/replication', '/reference/read-concern', '/reference/security', '/reference/sharding', '/reference/write-concern', '/release-notes/2.4', '/release-notes/2.6', '/release-notes/2.8', '/release-notes/3.0', '/release-notes/3.2', '/release-notes/3.4', '/release-notes/3.6', '/release-notes/4.0', '/release-notes/4.2', '/security', '/sharding', '/changeStreams', '/core/zone-sharding', '/core/hashed-sharding', '/core/ranged-sharding', '/storage', '/tutorial/change-sharded-cluster-wiredtiger', '/tutorial/insert-documents', '/tutorial/query-documents', '/tutorial/remove-documents', '/tutorial/update-documents', '/tutorial/enable-authentication', '/tutorial/install-mongodb-on-ubuntu', '/tutorial/install-mongodb-on-windows', '/tutorial/install-mongodb-on-red-hat', '/tutorial/install-mongodb-on-debian', '/tutorial/install-mongodb-on-suse', '/tutorial/install-mongodb-on-amazon', '/tutorial/install-mongodb-enterprise-on-ubuntu', '/tutorial/install-mongodb-enterprise-on-windows', '/tutorial/install-mongodb-enterprise-on-red-hat', '/tutorial/install-mongodb-enterprise-on-debian', '/tutorial/install-mongodb-enterprise-on-suse', '/tutorial/install-mongodb-enterprise-on-amazon', '/tutorial/install-mongodb-on-os-x'];
  </script></body>
</html>